To replace platform_reset with custom reset logic

4 posts / 0 new
Last post
hardy.chen
Offline
Last seen:1 year 10 months ago
加入:2015-03-13 04:20
To replace platform_reset with custom reset logic

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:
Gongyu_Dialog
Offline
Last seen:6 days 14 hours ago
加入:2016-04-27 07:07
Hi, Hardy

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

Gongyu_Dialog
Offline
Last seen:6 days 14 hours ago
加入:2016-04-27 07:07
嗨,hardy.chen

嗨,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.取代“platform_reset" with "custom_platform_reset_func"

hardy.chen
Offline
Last seen:1 year 10 months ago
加入:2015-03-13 04:20
Hi Dialog team,

Hi Dialog team,

Thanks! This works!

Topic locked