2 Replies Latest reply on Apr 19, 2018 1:59 PM by alden0303_3313971

    Custom bootloader for CY8C58LP


      Hello everyone,


      I'm trying to create a custom bootloader for CY8C58LP using the PSOC Creator.

      Both the bootloader and the application work fine individually.

      However, when the execution jumps from the bootloader to the application, the application doesn't behave as expected.



      As UDB modules the bootloader uses mainly the UART and SPI which are used by the application as well.



      1. I've tried first to create the bootloader without any knowledge of the application UDB - modules. I wanted it to be generic.

      However, nothing was working when I was launching the application, not even the UART which was obviously the same.



      2. Then I decided to have the exact configuration for the bootloader as for the application, at least to have something working.

      Basically I copied the application project with all its settings in the TopDesign.cysch, so the same blocks are shared by the bootloader.

      Now jumping to the application works much better: UART works fine, interrupts are OK (I see the time tick incrementing OK).



      However, SPI is dead (it is not using interupts). I have noticed that the SPI module doesn't even show under PSOC Debug->Components.

      Also, from time to time I get a surious interrupt and execution gets stuck in the Cm3Start.c::CY_ISR(IntDefaultHandler)



      I've traced the code from the application Cm3Start.c::Start_c() and it goes through the __libc_init_array and everythin, cyfitter.c and

      initialize_psoc(that's where the interrupts are properly setup and the vector is moved into RAM belonging to the application).



      Most likely something is missing, but not sure what.

      Any help would be greatly appreciated.

        • 1. Re: Custom bootloader for CY8C58LP

          Yes, something seems to be wrong. Difficult to tell what, can you share the projects, Bootloader and Bootloadable? Use Creator -> File-> Create workspace bundle (minimal) and upload the resulting .zip.


          from time to time I get a spurious interrupt and execution gets stuck in the Cm3Start.c::CY_ISR(IntDefaultHandler) This is mostly caused by a clobbered stack or bad pointer handling leading to accessing non-existing memory etc.



          • 2. Re: Custom bootloader for CY8C58LP

            Hi Bob,

            Thank you for your reply. I'll try to create a simpler project that exhibits this behavior (my app is pretty complex) and post the project so that yo can take a look.

            It will take few days until then, I have to finish something else meanwhile.