DA14531 (WLCSP17) Cannot flash external SPI (or read OTP) - Failed clearing memory address 7FC3C08. Failed configuring SPI ports and pins.

Question

How can we let SmartSnippets Toolbox turn off HW_RESET, or otherwise customize the jtag_programmer.bin ?

Context

We have been able to run our firmware (based on the ble_app_example, for SDK version: 6.0.14.1114) using Keil - so we know we can program the RAM fine.

However, once we try and use our external SPI flash we run into an error.

Looking at the scope traces of the chips Boost voltage (BAT_HIGH), we believe it is because the HW_RESET is left enabled, the voltage boosts from 1.8V to 3V for 10ms before crashing to the supply of 1.5V and then raising back to 1.8V.

We were able to fix this issue (when running from RAM) by adding the following to the start of our code: 

GPIO_Disable_HW_Reset();

 But now we are seeing the same behaviour in our boost voltage when programming with SmartSnippets, we think this is because the jtag_programmer.bin (that is flashed first) needs modifying in the same way.

We have a custom board where we are reusing various pins, due to pin constrains we cannot turn on the SPI flash via a GPIO, but are using a suitable configuration to be under the 50uA limit for the BAT_HIGH pin.

DA14531 Pin Assigned Pin
P0_4 SPIB_SCK
P0_1 SPIB_CS
P0_3 SPIB_MISO
P0_0 / RST SPIB_MOSI
P0_5 SWDIO (JTAG)
P0_2 SWCLK (JTAG)


However when trying to use the SmartSnippets Toolbox or command line we run into the following

[ERROR   SPI Flash Programmer@23-03-21 12:13:20] Failed reading memory at address 0x7FC3C08.
[WARNING SPI Flash Programmer@23-03-21 12:13:20] Failed configuring SPI ports and pins.

Command line arguments used (powershell)

& 'C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.22\SmartSnippetsToolbox.exe' -type spi -chip DA14531 -clk P0_4 -cs P0_1 -miso P0_3 -mosi P0_0 -jtag 601004718 -cmd write -offset 0x0000 -file "C:\Projects\da14531-firmware\Keil_5\out_DA14531\Objects\fwa_531.bin" -max 0x400000 -firmware "C:\Projects\da14531-firmware\sdk\config\toolbox_resources\DA1453x\common\jtag_programmer.bin" -bootable
Full Output:
Launching SmartSnippets Toolbox v5.0.22.4084
Loaded the following properties from C:\Users\CDP\SmartSnippetsToolbox\properties.txt
{ENABLE_HIDDEN_TOOLS=true, ENABLE_TS=true, ENABLE_MP=false, ENABLE_TE=true}
Command line arguments:
-type spi -chip DA14531 -clk P0_4 -cs P0_1 -miso P0_3 -mosi P0_0 -jtag 601004718 -cmd write -offset 0x0000 -file C:\Projects\da14531-firmware\Keil_5\out_DA14531\Objects\fw_531.bin -max 0x400000 -firmware C:\Projects\da14531-firmware\sdk\config\toolbox_resources\DA1453x\common\jtag_programmer.bin -bootable
Found SW-DP with ID 0x0BC11477
Scanning AP map to find all available APs
AP[1]: Stopped AP scan as end of AP map has been reached
AP[0]: AHB-AP (IDR: 0x04770031)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
Found Cortex-M0 r0p1, Little endian.
FPUnit: 4 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
BTLE device selected.
Found SW-DP with ID 0x0BC11477
AP map detection skipped. Manually configured AP map found.
AP[0]: AHB-AP (IDR: Not set)
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
Found Cortex-M0 r0p1, Little endian.
FPUnit: 4 code (BP) slots and 0 literal slots
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Firmware File C:\Projects\da14531-firmware\sdk\config\toolbox_resources\DA1453x\common\jtag_programmer.bin has been selected for downloading.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Successfully downloaded firmware file to the board.
Using default baudrate: 115200 Bd.
Added bootable header to image.
Started burning memory with 20764 bytes of data at address 0x00000.
Failed clearing memory address 7FC3C08.
Failed configuring SPI ports and pins.
Failed clearing memory address 7FC3C08.
Fail write 16384 bytes at offset 0x00
Memory burning failed.


Update 2023/03/22 

When using the SmartSnippets toolbox (GUI) I am also unable to read the OTP memory. I can confirm I am able to use the GUI tool to read the OTP memory of the devboard kit.

Parents
  • Hi There,

    Thank you for posting your question online.
    Can you share the external SPI Flash you are working on? You can find the supported SPI Flash modules for DA14531 on the AN-B-088 document:AN-B-088: DA145xx Flash Selector Guide (renesas.com)
    You should also refer to the AN-B-072 document: AN-B-072: DA14531 Booting from OTP and Serial Interfaces (renesas.com)
    On chapter 4.Booting Sequence and Booting Pins you can find this table:

    The pins you have selected are for SPI slave. If you want to use a combination of pins not highlighted on this table you should configure the secondary_bootloader or you should burn the OTP System Preferences header accordingly.
    The PIN configuration you have selected, is the default one. So you do not need to configure the SPI pins via CLI.
    Can you please try a CLI command on the powershell that would look like this:

    SmartSnippetsToolbox.exe -type spi -chip DA14531 -jtag JTAG_ID -firmware "jtag_programmer_531.bin" -cmd write -file *bin/hex file location" -verify


    Your JTAG pins are correct according to the DA14531 Datasheet, since you were able to download from the Keil IDE to the DA14531 RAM as well.


    Kind Regards,
    OV_Renesas

Reply
  • Hi There,

    Thank you for posting your question online.
    Can you share the external SPI Flash you are working on? You can find the supported SPI Flash modules for DA14531 on the AN-B-088 document:AN-B-088: DA145xx Flash Selector Guide (renesas.com)
    You should also refer to the AN-B-072 document: AN-B-072: DA14531 Booting from OTP and Serial Interfaces (renesas.com)
    On chapter 4.Booting Sequence and Booting Pins you can find this table:

    The pins you have selected are for SPI slave. If you want to use a combination of pins not highlighted on this table you should configure the secondary_bootloader or you should burn the OTP System Preferences header accordingly.
    The PIN configuration you have selected, is the default one. So you do not need to configure the SPI pins via CLI.
    Can you please try a CLI command on the powershell that would look like this:

    SmartSnippetsToolbox.exe -type spi -chip DA14531 -jtag JTAG_ID -firmware "jtag_programmer_531.bin" -cmd write -file *bin/hex file location" -verify


    Your JTAG pins are correct according to the DA14531 Datasheet, since you were able to download from the Keil IDE to the DA14531 RAM as well.


    Kind Regards,
    OV_Renesas

Children
  • We are currently using: AT25DF041B-UUN-T, which appears to not be in the list of supported modules listed (Are you able to share why that might be the case?). 

    Here is the output of the command suggested (note: I had to manually enter Y for a bootable SPI)

    & 'C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.22\SmartSnippetsToolbox.exe' -type spi -chip DA14531 -jtag 601004718 -cmd write -file "C:\Projects\da14531-firmware\Keil_5\out_DA14531\Objects\fw_531.bin" -firmware "C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.22\common_resources\SupportPackages\DA1453x\toolbox_resources\common\jtag_programmer_531.bin" -bootable -verify
    
    Launching SmartSnippets Toolbox v5.0.22.4084
    Loaded the following properties from C:\Users\CDP\SmartSnippetsToolbox\properties.txt
    {ENABLE_HIDDEN_TOOLS=true, ENABLE_TS=true, ENABLE_MP=false, ENABLE_TE=true}
    Command line arguments:
    -type spi -chip DA14531 -jtag 601004718 -cmd write -file C:\Projects\da14531-firmware\Keil_5\out_DA14531\Objects\fw_531.bin -firmware C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.22\common_resources\SupportPackages\DA1453x\toolbox_resources\common\jtag_programmer_531.bin -bootable -verify
    Found SW-DP with ID 0x0BC11477
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x04770031)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    BTLE device selected.
    Found SW-DP with ID 0x0BC11477
    AP map detection skipped. Manually configured AP map found.
    AP[0]: AHB-AP (IDR: Not set)
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Firmware File C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.22\common_resources\SupportPackages\DA1453x\toolbox_resources\common\jtag_programmer_531.bin has been selected for downloading.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    T-bit of XPSR is 0 but should be 1. Changed to 1.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Successfully downloaded firmware file to the board.
    Using default baudrate: 115200 Bd.
    Do you want SPI Flash memory to be bootable? ([Y / N]?)
    Y
    Added bootable header to image.
    Started burning memory with 21396 bytes of data at address 0x00000.
    Failed clearing memory address 7FC3C08.
    Failed configuring SPI ports and pins.
    Failed clearing memory address 7FC3C08.
    Fail write 16384 bytes at offset 0x00
    Memory burning failed.

  • I can also add that I cannot read the OTP either, also getting a similar error

    [INFO     General@23-03-22 10:53:59] Found SW-DP with ID 0x0BC11477
    [INFO     General@23-03-22 10:53:59] Scanning AP map to find all available APs
    [INFO     General@23-03-22 10:53:59] AP[1]: Stopped AP scan as end of AP map has been reached
    [INFO     General@23-03-22 10:53:59] AP[0]: AHB-AP (IDR: 0x04770031)
    [INFO     General@23-03-22 10:53:59] Iterating through AP map to find AHB-AP to use
    [INFO     General@23-03-22 10:53:59] AP[0]: Core found
    [INFO     General@23-03-22 10:53:59] AP[0]: AHB-AP ROM base: 0xE00FF000
    [INFO     General@23-03-22 10:53:59] CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    [INFO     General@23-03-22 10:53:59] Found Cortex-M0 r0p1, Little endian.
    [INFO     General@23-03-22 10:53:59] FPUnit: 4 code (BP) slots and 0 literal slots
    [INFO     General@23-03-22 10:53:59] CoreSight components:
    [INFO     General@23-03-22 10:53:59] ROMTbl[0] @ E00FF000
    [INFO     General@23-03-22 10:53:59] ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    [INFO     General@23-03-22 10:53:59] ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    [INFO     General@23-03-22 10:53:59] ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    [INFO     General@23-03-22 10:53:59] BTLE device selected.
    [INFO     OTP@23-03-22 10:53:59] Found SW-DP with ID 0x0BC11477
    [INFO     OTP@23-03-22 10:53:59] AP map detection skipped. Manually configured AP map found.
    [INFO     OTP@23-03-22 10:53:59] AP[0]: AHB-AP (IDR: Not set)
    [INFO     OTP@23-03-22 10:53:59] AP[0]: Core found
    [INFO     OTP@23-03-22 10:53:59] AP[0]: AHB-AP ROM base: 0xE00FF000
    [INFO     OTP@23-03-22 10:53:59] CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    [INFO     OTP@23-03-22 10:53:59] Found Cortex-M0 r0p1, Little endian.
    [INFO     OTP@23-03-22 10:53:59] FPUnit: 4 code (BP) slots and 0 literal slots
    [INFO     OTP@23-03-22 10:53:59] CoreSight components:
    [INFO     OTP@23-03-22 10:53:59] ROMTbl[0] @ E00FF000
    [INFO     OTP@23-03-22 10:53:59] ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    [INFO     OTP@23-03-22 10:53:59] ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    [INFO     OTP@23-03-22 10:53:59] ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    [INFO     OTP@23-03-22 10:53:59] Reset: Halt core after reset via DEMCR.VC_CORERESET.
    [INFO     OTP@23-03-22 10:53:59] Reset: Reset device via AIRCR.SYSRESETREQ.
    [INFO     OTP@23-03-22 10:54:00] Firmware File C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.22\common_resources\SupportPackages\DA1453x\toolbox_resources/common/jtag_programmer_531.bin has been selected for downloading.
    [INFO     OTP@23-03-22 10:54:00] Reset: Halt core after reset via DEMCR.VC_CORERESET.
    [INFO     OTP@23-03-22 10:54:00] Reset: Reset device via AIRCR.SYSRESETREQ.
    [WARNING  OTP@23-03-22 10:54:00] T-bit of XPSR is 0 but should be 1. Changed to 1.
    [INFO     OTP@23-03-22 10:54:00] Reset: Halt core after reset via DEMCR.VC_CORERESET.
    [INFO     OTP@23-03-22 10:54:00] Reset: Reset device via AIRCR.SYSRESETREQ.
    [INFO     OTP@23-03-22 10:54:00] Successfully downloaded firmware file to the board.
    [INFO     OTP@23-03-22 10:54:04] Started reading 32768 bytes from memory.
    [INFO     OTP@23-03-22 10:54:04] Started reading 32768 bytes from OTP memory address 0x7F80000.
    [ERROR    OTP@23-03-22 10:54:04] Failed clearing memory address 7FC3C08.
    [ERROR    OTP@23-03-22 10:54:04] OTP memory reading has failed.
    [ERROR    OTP@23-03-22 10:54:04] Failed reading memory.

  • Hi There,

    Thank you for the reply.
    Not being able to burn the SPI Flash is expected due to the fact you are using the AT25DF041B SPI Flash. 
    But you should be able to read the OTP memory. What command did you try for OTP?
    This is my logs when burning the SPI Flash with the prox_reporter:

    C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.20>SmartSnippetsToolbox.exe -type spi -chip DA14531 -jtag 480071870 -firmware "jtag_programmer_531.bin" -cmd write -file prox_reporter_531.hex -verify
    Launching SmartSnippets Toolbox v5.0.20.4060
    Loaded the following properties from C:\Users\ovasinio\SmartSnippetsToolbox\properties.txt
    {ENABLE_HIDDEN_TOOLS=true, ENABLE_TS=true, ENABLE_MP=true, ENABLE_TE=true}
    Command line arguments:
    -type spi -chip DA14531 -jtag 480071870 -firmware jtag_programmer_531.bin -cmd write -file prox_reporter_531.hex -verify
    Found SW-DP with ID 0x0BC11477
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x04770031)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    BTLE device selected.
    Found SW-DP with ID 0x0BC11477
    AP map detection skipped. Manually configured AP map found.
    AP[0]: AHB-AP (IDR: Not set)
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Firmware File jtag_programmer_531.bin has been selected for downloading.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Successfully downloaded firmware file to the board.
    Using default baudrate: 115200 Bd.
    Do you want SPI Flash memory to be bootable? ([Y / N]?)
    y
    Added bootable header to image.
    Started burning memory with 29752 bytes of data at address 0x00000.
    Successfully configured SPI ports and pins.
    Write 16384 bytes at offset 0x00
    Write 13368 bytes at offset 0x4000
    Memory burning completed successfully.
    Reading memory to verify its contents after burn...
    Read 16384 bytes from offset 0x00
    Read 13368 bytes from offset 0x4000
    SPI Flash  memory verification succeeded.
    Send reset command. If application won't start replug the board.
    After that I was able to see my DA14531 advertising. 
    And for reading the OTP header:
    C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.20>SmartSnippetsToolbox.exe -type otp -chip DA14531 -jtag 480071870 -firmware "jtag_programmer_531.bin" -cmd read_header -file otp_read.txt -y
    Launching SmartSnippets Toolbox v5.0.20.4060
    Loaded the following properties from C:\Users\ovasinio\SmartSnippetsToolbox\properties.txt
    {ENABLE_HIDDEN_TOOLS=true, ENABLE_TS=true, ENABLE_MP=true, ENABLE_TE=true}
    Command line arguments:
    -type otp -chip DA14531 -jtag 480071870 -firmware jtag_programmer_531.bin -cmd read_header -file otp_read.txt -y
    Found SW-DP with ID 0x0BC11477
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x04770031)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    BTLE device selected.
    Found SW-DP with ID 0x0BC11477
    AP map detection skipped. Manually configured AP map found.
    AP[0]: AHB-AP (IDR: Not set)
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Firmware File jtag_programmer_531.bin has been selected for downloading.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Successfully downloaded firmware file to the board.
    Using default baudrate: 115200 Bd.
    Memory contents exported successfully to otp_read.txt
    Reading is complete. Read  304 bytes.
    I had created the otp_read.txt file and after reading the OTP header I can see:

    So it worked as expected.
    Regarding the AT25DF041B Flash Memory:
    The AT25DF041B has a Ultra-Deep Power-Down (UDPD) mode, which takes more time to wake-up the device than the one the DA14531 BootROM supports. That is why you will have to use the secondary_bootloader.
    If you go on sdk_path\utilities\secondary_bootloader 
    You will find the secondary_bootloader project. You will need to find and define the macro:
    /****************************************************************************************************************/
    /* Enable extra wait time after release from Ultra Deep Power-Down (UDPD). Mainly required for the              */
    /* Adesto/Dialog SPI flash memories which support the UDPD command.                                             */
    /****************************************************************************************************************/
    #undef CFG_SPI_FLASH_ADESTO_UDPD

    You could burn this secondary_bootloader into the OTP in order to use it to download your FW into the AT25DF041B Flas Memory, or you could use J-link to connect to the AT25DF041B, burn the secondary_bootloader and then use CLI commands/ SmartSnippets Toolbox to burn your FW into the Flash.

    Kind Regards,
    OV_Renesas

  • Thanks for the reply.

    I'll focus on the OTP reading/writing issue for now (as without it I can't add the secondary bootloader anyway).

    I am seeing the same behaviour both from the command line ad when reading in the SmartSnippets GUI.

    I have also tried customizing the `flash_programmer` provided in the SDK, specifically I have modified utilities\flash_programmer\include\user_periph_setup.h Line 223, to comment out the define related to using the HW RESET line.

    #if defined (__DA14531__)
    // Define CFG_HW_RESET_P00 to enable hw_reset operation in P00
    // #define CFG_HW_RESET_P00

    When I do this I can see that the board successfully reaches the 3V at the BAT_HIGH pin (ie is operating in boost mode) 

    This is the command I am using 

    & 'C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.22\SmartSnippetsToolbox.exe' -type otp -chip DA14531 -jtag 601004718 -baudrate 57600 -cmd read_header -file "$env:USERPROFILE\Downloads\header.hex" -firmware "C:\Projects\da14531-sdk\utilities\flash_programmer\out_DA14531_JTAG\Objects\jtag_programmer_531.bin"

    With the following output

    Command line arguments:
    -type otp -chip DA14531 -jtag 601004718 -baudrate 57600 -cmd read_header -file C:\Users\CDP\Downloads\header.hex -firmware C:\Projects\da14531-sdk\utilities\flash_programmer\out_DA14531_JTAG\Objects\jtag_programmer_531.bin -y
    Found SW-DP with ID 0x0BC11477
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x04770031)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    BTLE device selected.
    Found SW-DP with ID 0x0BC11477
    AP map detection skipped. Manually configured AP map found.
    AP[0]: AHB-AP (IDR: Not set)
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Firmware File C:\Projects\da14531-sdk\utilities\flash_programmer\out_DA14531_JTAG\Objects\jtag_programmer_531.bin has been selected for downloading.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    T-bit of XPSR is 0 but should be 1. Changed to 1.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Successfully downloaded firmware file to the board.
    Failed reading memory at address 0x7FC4000.
    Failed reading memory. Please try again.

  • Hi There,

    Thank you for the reply.
    I used the exact same command you used but I saved the results on a .txt file instead.

    C:\Program Files\SmartSnippetsToolbox\SmartSnippetsToolbox5.0.20>SmartSnippetsToolbox.exe -type otp -chip DA14531 -jtag 480071870 -firmware jtag_programmer.bin -cmd read_header -file otp_read.txt -baudrate 57600
    Launching SmartSnippets Toolbox v5.0.20.4060
    Loaded the following properties from C:\Users\ovasinio\SmartSnippetsToolbox\properties.txt
    {ENABLE_HIDDEN_TOOLS=true, ENABLE_TS=true, ENABLE_MP=true, ENABLE_TE=true}
    Command line arguments:
    -type otp -chip DA14531 -jtag 480071870 -firmware jtag_programmer.bin -cmd read_header -file otp_read.txt -baudrate 57600
    Found SW-DP with ID 0x0BC11477
    Scanning AP map to find all available APs
    AP[1]: Stopped AP scan as end of AP map has been reached
    AP[0]: AHB-AP (IDR: 0x04770031)
    Iterating through AP map to find AHB-AP to use
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    BTLE device selected.
    Found SW-DP with ID 0x0BC11477
    AP map detection skipped. Manually configured AP map found.
    AP[0]: AHB-AP (IDR: Not set)
    AP[0]: Core found
    AP[0]: AHB-AP ROM base: 0xE00FF000
    CPUID register: 0x410CC601. Implementer code: 0x41 (ARM)
    Found Cortex-M0 r0p1, Little endian.
    FPUnit: 4 code (BP) slots and 0 literal slots
    CoreSight components:
    ROMTbl[0] @ E00FF000
    ROMTbl[0][0]: E000E000, CID: B105E00D, PID: 000BB008 SCS
    ROMTbl[0][1]: E0001000, CID: B105E00D, PID: 000BB00A DWT
    ROMTbl[0][2]: E0002000, CID: B105E00D, PID: 000BB00B FPB
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Firmware File jtag_programmer.bin has been selected for downloading.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Reset: Halt core after reset via DEMCR.VC_CORERESET.
    Reset: Reset device via AIRCR.SYSRESETREQ.
    Successfully downloaded firmware file to the board.
    Memory contents exported successfully to otp_read.txt
    Reading is complete. Read  304 bytes.

    I even changed to #undef CFG_HW_RESET_P00 as you did on the user_periph_setup.h file and I was still able to read the contents of the OTP.
    Do you have any of our Development Kits or only the custom board?
    If you have any of our Development Kits could you try to read the OTP with that so we can see if it is working there?

    Kind Regards,
    OV_Renesas

  • Thanks for the reply.

    I can confirm that with a devkit I have been able to read the OTP using the GUI and CLI.

    I have attempted, on our custom PCB, removing the SPI flash chip in case it was causing havoc on the reset line, but still am unable to read the OTP.

  • Hi There,

    Thank you for the reply.
    Since you are able to read the OTP via the DevKit, could you kindly share a schematic of your custom board so we could check?

    Kind Regards,
    OV_Renesas

  • Thanks, is there a way to share the schematic confidentially to you (rather than publicly in the forum)?

  • Hi There,

    Yes, you can raise a private ticket. It is 1 on 1 and totally confidential. 
    On the Renesas website go on Sales & Support and then select Online Support Resources:

    After that this page should show up:

    Select the Submit a Ticket option and fill the ticket form. 
    Note: You should be logged in in order to do that, and you should set Wireless Connectivity on the Group option of the form.

    Kind Regards,
    OV_Renesas

  • Thanks, due to certain NDA on our side I need to get the necessary permission before continuing.

    The other avenue I have tried exploring is directly inspecting the registers by running a debug session with the `flash_programmer`.

    I can confirm that both with the Dev Kit board and the Target PCB I have been able to see the same values:

     

    I looked at the `TARGET_MEMORY` location (as defined in the code, 0x07FC4000) and it appears to read something.

    Additionally I looked at 0x07F87FC8 - which according to the SmartSnippets toolbox is where the OTP memory is stored for the Boot config, as we also get a value (that matches the dev kit).