How to reset the DA14535 via SWD

Translator

Translator
Translator

Hello Community,

We are working on a battery-powered ultrasonic flow meter using the DA14531MOD as
Hello Community,

I have developed a programming algorithm to program the external SPI memory connected to the DA14535 via SWD. It works fine when both the device and the SPI memory are empty. However, as soon as the memory is programmed with a valid image and the OTP is programmed with the following values:

0x07F87FC8 -> 0x027FABAA
0x07F82FCC -> 0x0B000106

The SPI commands does not work. Specifically, it does not drive even the CS pin. It always works fine with the SmartSnippet Toolbox regardless of whether the memory is programmed or empty.

I suspect that we are missing some initialization in our code due to the fact the microcontroller boot flow is different. In fact, looking at the boot ROM sequence shown in Picture 17 of the datasheet, the flow differs depending on whether the application is programmed or not. We do perform a software reset by writing AIRCR = 0x05FA0004, but it seems not enough to start from the same state as it were virgin.

Could you suggest the possible cause of the problem? Should we perform an hardware reset through the watchdog registers?

Would it be possible for you to share the source code of "jtag_programmer_535.bin" to help speed up the resolution of this issue? Is it obtained from DA145xx_SDK\6.0.22.1401\utilities\flash_programmer\" source code? Does the SmartSnippet Toolbox only perform a software reset?

Thanks in advance for your help.

Best Regards,

Luca Zanuttini

Parents
  • Hi Luca,

    I am not sure if you have disabled the Reset pin as P00. 

    Anyway, A power cycle will always work as a HW reset function.

    BR,

    JH_Renesas

  • Translator

    Translator

    Hi,

    Thank you for your reply.

    The Reset pin also serves as the CS for the SPI memory, as configured through the OTP address 0x7F82FCC once programmed. I assume that, after a power cycle, the boot ROM will follow the same sequence that I want to avoid. Is that correct?

    Ideally, I would like to prevent the SWD port from resetting or configure the device in a way that makes it behave as if the memory were empty. Is that possible? Basically, I would like to perform the same actions as SmartSnippet Toolbox, and from what I see in the log, it should only perform a software reset via AIRCR, right? However, in this way, the SPI peripheral does not work as expected. I am concerned that I should perform other actions in order to initialize he SPI peripheral correctly.

    What about the other two questions:

    Would it be possible for you to share the source code of "jtag_programmer_535.bin" to help speed up the resolution of this issue? Is it obtained from DA145xx_SDK\6.0.22.1401\utilities\flash_programmer\" source code?

    Best Regards,

    Luca Zanuttini

Reply
  • Translator

    Translator

    Hi,

    Thank you for your reply.

    The Reset pin also serves as the CS for the SPI memory, as configured through the OTP address 0x7F82FCC once programmed. I assume that, after a power cycle, the boot ROM will follow the same sequence that I want to avoid. Is that correct?

    Ideally, I would like to prevent the SWD port from resetting or configure the device in a way that makes it behave as if the memory were empty. Is that possible? Basically, I would like to perform the same actions as SmartSnippet Toolbox, and from what I see in the log, it should only perform a software reset via AIRCR, right? However, in this way, the SPI peripheral does not work as expected. I am concerned that I should perform other actions in order to initialize he SPI peripheral correctly.

    What about the other two questions:

    Would it be possible for you to share the source code of "jtag_programmer_535.bin" to help speed up the resolution of this issue? Is it obtained from DA145xx_SDK\6.0.22.1401\utilities\flash_programmer\" source code?

    Best Regards,

    Luca Zanuttini

Children
  • Would it be possible for you to share the source code of "jtag_programmer_535.bin" to help speed up the resolution of this issue? Is it obtained from DA145xx_SDK\6.0.22.1401\utilities\flash_programmer\" source code?

    Yes, it is.

    The Reset pin also serves as the CS for the SPI memory, as configured through the OTP address 0x7F82FCC once programmed. I assume that, after a power cycle, the boot ROM will follow the same sequence that I want to avoid. Is that correct?

    Yes

    Basically, I would like to perform the same actions as SmartSnippet Toolbox, and from what I see in the log, it should only perform a software reset via AIRCR, right? However, in this way, the SPI peripheral does not work as expected. I am concerned that I should perform other actions in order to initialize he SPI peripheral correctly.

    About the toolbox you can config the SPI pin map here:

  • Hi,

    Yes, SmartSnippet Toolbox works fine, but I need to replicate the same functionality using our tool. The problem is that when the external memory is programmed with valid firmware, the SPI peripheral does not behave the same way as when the external memory is empty.

    Should I restore each register whose value is not affected by a software reset to its default value? I mean these registers:

    Translator

    Best Regards,

    Luca

  • 1, 6. SPI booting Options

    2, Do you have changed the GPIOs as what you have programed to the OTP in the flash_programer project: