CYBLE-212019 bootloading(single stack bootloader) using external host - Error code 0x4004

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

cross mob
DhDa_2432241
Level 5
Level 5
5 likes given First like received First like given

Hello,

I am using CYBLE-212019 with a single stack bootloader. I was able to successfully bootload a string image using an external embedded host over UART. During bootloading, bootloader reported error 0x4004. From cybtldr_utils.h, 0x4004 is a combination of CYRET_ERR_BTLDR_MASK and CYRET_ERR_DATA.

I regenerated .cyacd file and started bootloading again. The headers(first line in .cyacd file) are verified but there is no response from the bootloader for the string line sent over UART. Embedded host is infinitely waiting for the bootloader response. Any suggestions on how to debug this?

EDIT:

Code is getting stuck in

int CyBtldr_TransferData(unsigned char* inBuf, int inSize, unsigned char* outBuf, int outSize)

{

    int err = g_comm->WriteData(inBuf, inSize);

    if (CYRET_SUCCESS == err){

        err = g_comm->ReadData(outBuf, outSize);

    }

    if (CYRET_SUCCESS != err)

        err |= CYRET_ERR_COMM_MASK;

    return err;

}

g_comm->ReadData() is infinitely waiting for the bootloader response.

OSCILLOSCOPE:

On the scope, BLE UART signal doesn't look like a square wave. It looks like a RC circuit charging signal. This means that UART is not initialized upon BLE reboot. At this point, it could be because bootloader didn't kick in or the chip went bad. I doubt the second is true. While I can always reflash bootloader using the SWD interface, I want to debug this issue without re-flashing bootloader and understand the reason for corruption and how to overcome it. Any ideas on how to proceed on this?

Thanks

Dheeraj

0 Likes
1 Solution

Hello,

It's been a while I have looked into it. My embedded host is Particle P1. From what I remember, I regenerated the .cyacd file again and it seemed to work. But I'm not sure what was wrong with my old file.

Also, when I tried it with the old .cyacd file, the MCU got bricked and the only way to recover it was to program it using PSOC programmer.

Thanks

Dheeraj

View solution in original post

0 Likes
7 Replies
himam_31
Employee
Employee
50 likes received 25 likes received 10 likes received

Hello Dheeraj,

Can you check the UART packets being sent from host and PSoC?

Thanks,

Hima

0 Likes

Hello Hima,

I couldn't get back in time for your reply on my earlier posts. I'll post the UART log shortly.

Thanks

Dheeraj

0 Likes

Hello,

The UART packet information is binary. Posting it here wouldn't make any sense. What exactly are you looking for? The bootloader codes are 0x00 for successful packets and then after a while I get 0x4004 and then the bootloading stops.

After power cycle, when I issue an OTAU the header in cyacd gets verified. The bootloading host expects 15 bytes in return but the bootloader reponds with 7 bytes only. As a result, the embedded host waits infinitely.

Thanks

Dheeraj

0 Likes
Anonymous
Not applicable

You probably have the baud rate set correctly for communications, but double checking they are both set to the correct value might be worth looking at quickly.

0 Likes

The baud rate is correct. Checked. Even if the baud rate is not correct, and if the module is unable to bootload correctly, a power cycle and asserting Bootload pin low should keep CYBLE in bootload state. But it's not happening.

0 Likes
Anonymous
Not applicable

What microcontroller are you using as the embedded host?
Would you be able to clarify how you actually got this to work? I desparately need to be able to update my PSOCs over I2C from an arduino

0 Likes

Hello,

It's been a while I have looked into it. My embedded host is Particle P1. From what I remember, I regenerated the .cyacd file again and it seemed to work. But I'm not sure what was wrong with my old file.

Also, when I tried it with the old .cyacd file, the MCU got bricked and the only way to recover it was to program it using PSOC programmer.

Thanks

Dheeraj

0 Likes