Hi,
I'm running our firmware and boot-code at external SPI flash, due to the power saving feature, the SPI flash will be powered off when there is no activity.
Following to some other discussions about the reset control with powering off SPI flash, I've add code to release power-off to SPI flash before calling reset at any exception handlers
1) HardFault_HandlerC
2) NMI_HandlerC
But I don't know when and where 'platform_reset' will be called inside the ROM code, can anyone give some instruction about how to implement my own platform_reset to replace it.
I'm using reference SDK DA14580_BEACON_3.40.6.
Device:
Hi, Hardy
Generally , the function platform_rest holds an error code as input parameter. Now the possible error code is in arch.h
ex. /// Reset platform and stay in ROM
#define RESET_TO_ROM 0xA5A5A5A5
You can call the function directly.
And then the PC will jump to 0x0. triggers the hardfault interrupt.
The easiest way in my opinion is to write a patch replacing the original platform_reset function.
It is beyond my scope about creating the patch, I send your question to the team. Waiting for the answer.
Thanks
Hi, hardy.chen
May have a try for the following method? Thanks
1. Go to the jump_table.c
2. Implement
void custom_platform_reset_func(uint32_t error)
{
/*TODO: Put the wake SPI flash function */
platform_reset_func(error); /* where error can be RESET_NO_ERROR */
}
3. Find out "platform_reset"
4. Replace the "platform_reset" with "custom_platform_reset_func"
Hi Dialog team,
Thanks! This works!