bootloader and WDT

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi,

I need some help regarding the bootloader.

I have implemented it acording to the AN from Cypress.

My needs : to be able to use the bootloader through Power On Reset AND Software reset

with the following source code which comes from the Cypress AN :

BootLoader(void){

// Check conditions for remote programming only through UART


// if was Power On Reset then check this


if (CPU_SCR0 & CPU_SCR0_PORS_MASK{

// Initiate UART Module

     //bootloader update firmware


Everything work fine while the WDT is disabled. I can acces to the bootloader by the two ways (POR and Software reset).

As soon as the WDT is enabled, only the POR works. Due to the if (CPU_SCR0 & CPU_SCR0_PORS_MASK, it looks like normal.

BUT, if I modify the bootloader by commenting the if line:

BootLoader(void){

// Check conditions for remote programming only through UART


// if was Power On Reset then check this


//if (CPU_SCR0 & CPU_SCR0_PORS_MASK{

// Initiate UART Module

     //bootloader update firmware

In that case, the bootloader should work whatever the source of reset. In pratice, when the WDT is enabled, if I make a software reset, the software crashes after the SW_Reset instruction.

2 questions:

- with the if (CPU_SCR0 & CPU_SCR0_PORS_MASK and WDT enabled , may I have a solution to go Inside the if (except POR of course?). Once the WDT is enabled I have no possiblity to disable it.

- May I use my bootlaoder without the if (CPU_SCR0 & CPU_SCR0_PORS_MASK and WDT enabled ? it seems not in my case????

Thanks a lot for your help.

0 Likes
1 Reply
SampathS_11
Moderator
Moderator
Moderator
250 sign-ins 250 solutions authored 5 questions asked

Hi,

if the condition CPU_SCR0 & CPU_SCR0_PORS_MASK is true, the WDT is disabled. Enabling WDT when boot loading is not practical, due to the flash writes involved.

Thanks,

Sampath

0 Likes