7 Replies Latest reply on May 23, 2018 3:51 PM by DheerajDake

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



      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?



      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.



      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?