Difficulty Setting Up Bootloader Example AN60317

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello,

We're in the prototype phase and have enough units that a bootloader has become necessary.
My starting place would be to get the AN60317 working but I'm having trouble even with that.

I'm working remote but I have 2 PSOC5 boards.  One is on a CY8CKIT-050 dev kit, the other is a custom board with similar circuitry.  Both of these boards have an I2C connection with each-other and to a Raspberry Pi (which has integrated pull-up resistors).  SCL is P12[4], SDA is P12[5].  I know the I2C connection is physically OK because If I put special projects on each Cypress board to give them unique slave addresses I can see them both from the Raspberry Pi.

The problem seems to be something with the Examples in AN60317, or with the way I've tried to convert or configure them.  I needed to modify the bootloader host project so to convert it from PSOC3 to PSOC5.  I had to upgrade both projects to a newer version of PSOC Creator.  I also needed to change the pins associated with the EZ-I2C device.

The bootloader host eval board simply says "Bootloading..."  on its LCD.

I've modified the bootloader host application to add debug code in an attempts to figure out where it is getting stuck.
This is what I've learned:
    In cybtldr_api.c is a function "CyBtldr_TransferData"

    The last line of code executed by this function is "int err = g_comm->WriteData(inBuf, inSize);"

    I know this because I print a message to the LCD immediately prior to this line and immediately after but I only see the first message.

The bootloader and bootloader applications I am trying to use are both attached to this email.

Why is the bootloader host hanging?

What additional steps do I need to take to continue troubleshoot this issue?

0 Likes
1 Solution
Anonymous
Not applicable

I figured this out.  It turns out that the bootloader-host I2C device was configured to use the wrong pins.

It would be nice if the Bootloader AN was updated to give better progress/diagnostic information while the attempted boot-load is in progress.

View solution in original post

4 Replies
GeonaP_26
Moderator
Moderator
Moderator
250 solutions authored 100 solutions authored 50 solutions authored

Please insert delay between WriteData call in the function call CyBtldr_TransferData and share your observations. Flash write can take as much as 20mS. If the flash write is in progress the slave will stretch the clock.

0 Likes
Anonymous
Not applicable

Hello

The attached image contains a screenshot of the original Cypress function except that it has added sprintf debug code. 
Also shown is an image of the LCD screen which shows where it gets stuck. 
I'd love to add this delay.  Could I use CyDelay(20)?  Which lines numbers should this be added to?

Results1.png

0 Likes
Anonymous
Not applicable

I performed similiar steps as above.  This time I decided to investigate what happens inside the "WriteData" function (shown in line 23 above).
From the speed timeOut counts, it'll take about 2 weeks to overflow and equal 0.  Is this the way the application note example is supposed to behave? 
I imagine this is an operation that should succeed in seconds.  How can I narrow down the source of the problem?  (I'm not certain the bootloader host is wrong.  For all I know the bootloader is where the problem lies.)

Results2.png

0 Likes
Anonymous
Not applicable

I figured this out.  It turns out that the bootloader-host I2C device was configured to use the wrong pins.

It would be nice if the Bootloader AN was updated to give better progress/diagnostic information while the attempted boot-load is in progress.