PSOC5LP Reset to Bootloader (without infinite wait)

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

cross mob
shepdog87
Level 3
Level 3
25 sign-ins 10 questions asked 10 replies posted

Hello,

We are using a PSoC5LP and just implemented our bootloader. We are going to program the bootloadable application via the i2c bus from another microcontroller.

The other microcontroller is responsible for sending a "Reset" command to the PSOC to get it into bootloader mode.

What is the correct sequence in the PSOC for the bootloadable application to issue a reset command so it can go into the bootloader, and then wait for the specified host link time in the bootloader?

This forum post [Link] says to do the following in the bootloadable application:

    Bootloadable_SET_RUN_TYPE(Bootloadable_SCHEDULE_BTLDR);

    CySoftwareReset();

However, when I browsed the generated source code of Bootloader.c, it appears that if SCHEDULE_BTLDER is set, then it will wait forever for the command, and not even check the wait time set in the bootloader component.

If CySoftwareReset() is used without setting the run type, does the PSOC reset to the bootloadable or bootloader?

We used a PSOC4 in a different application, and our reset process was to enable the watchdog so we could reset from that. PSOC5LP is different, because the watchdog API is not as flexible as the PSOC4. Our watchdog is already going to monitor the application, and the timeout is too much for us to use for this purpose.

0 Likes
1 Solution
BiBi_1928986
Level 7
Level 7
First comment on blog 500 replies posted 250 replies posted

Hello.

In Bootloadable, I call CySoftwareReset() without using
Bootloadable_SET_RUN_TYPE(Bootloadable_SCHEDULE_BTLDR).
I find Bootloadable_SET_RUN_TYPE(Bootloadable_SCHEDULE_BTLDR) causes the Bootloader to stay in Bootloader mode waiting forever (even when "Wait for Command" has been configured in Bootloadable component).

By only calling CySoftwareReset() from Bootloadable, the PSoC does a software reset, executes the Bootloader while waiting for the "Wait for Command" timeout before jumping to Bootloadable.   So, it doesn't wait forever in Bootloader.  This works.

View solution in original post

0 Likes
4 Replies
pacr_284376
Level 5
Level 5
100 replies posted 10 solutions authored 50 sign-ins

I use Bootloader_Load and it works as it should.

I dont see Bootloadable_SET_RUN_TYPE in the Bootloadable datasheet but might be overlooking something

Patrick

0 Likes
shepdog87
Level 3
Level 3
25 sign-ins 10 questions asked 10 replies posted

Hi Patrick - Thanks for the reply.

I looked at the Bootloader_Load function in the generated source code and found this:

void Bootloadable_Load(void) 
{
    /* Schedule Bootloader to start after reset */
    Bootloadable_SET_RUN_TYPE(Bootloadable_SCHEDULE_BTLDR);

    CySoftwareReset();
}

It looks like this function is calling the same thing I do. If you reset with this command, but don't update the bootloadable image, does the PSOC stay in the bootloader indefinitely?

0 Likes
pacr_284376
Level 5
Level 5
100 replies posted 10 solutions authored 50 sign-ins

It stays waiting forever, unless you update. I activate a LED so I can see if its in bootloader state.

If I do a power-off it restarts normally; not in Bootloading waiter. 

I guess there is also an I2C command to exit bootloading-state but I never tried that. I only use the Bootloader-Host program that is integrated (called) in PSOCCreator.

Mind that there also is a bootloader application integrated in I2CBridge software but that doesnt work (I guess its for PSOC1 or something like that). 

 

0 Likes
BiBi_1928986
Level 7
Level 7
First comment on blog 500 replies posted 250 replies posted

Hello.

In Bootloadable, I call CySoftwareReset() without using
Bootloadable_SET_RUN_TYPE(Bootloadable_SCHEDULE_BTLDR).
I find Bootloadable_SET_RUN_TYPE(Bootloadable_SCHEDULE_BTLDR) causes the Bootloader to stay in Bootloader mode waiting forever (even when "Wait for Command" has been configured in Bootloadable component).

By only calling CySoftwareReset() from Bootloadable, the PSoC does a software reset, executes the Bootloader while waiting for the "Wait for Command" timeout before jumping to Bootloadable.   So, it doesn't wait forever in Bootloader.  This works.

0 Likes