This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Boot-Loader

Other Parts Discussed in Thread: CC2531

 

Hello,

I am in the software design stage of my application. It is being developed with ZigBee technology, specifically with cc2531 solution and using ZNP software tool. These days, I have been using also Boot-loader project and some ideas have come to my mind. I mean, the boot loader is used to update the firmware of the ZigBee USB every time this is connected and detected. Then, what I have been thinking is giving the chance to update this firmware not only when the USB connection is detected, but also, after a while, if this is wanted.

I have been thinking how to implement a boot loader functionality in every moment and I have had some ideas, although not very good results have been achieved. First of all, I would like to ask you if this is possible or, if you have come up with this, how you solved it.

My idea was to use a not defined command from ZNP in order to warn every time the boot loader functionality is required. In this way, if the USB reads this command I defined it will be able to know that the boot loader command has to be executed. What do you think about this solution? Could it work?

In order to carry out the above solution, I added the four boot-loader files to the ZNP project in which I was working and, besides, I included their directories. Unfortunately, I am doing sth wrong, as some errors appear when the project is compiled. Until now, Do you know if there is sth. I am not taking into account? The error I got is the following: Normal 0 21 false false false ES X-NONE X-NONE MicrosoftInternetExplorer4

Error[Pa037]: function type not callable , usbirqHandler();

It seems there is some problem with the interrupts between Boot-loader and ZNP, but I don't know how to solve it and why is this happening.

 

I will be very grateful if any of you could help me,

Thank you very much in advance,

 

Lucía

 

  • Your problem is already solved by the ZNP boot loader - after powerup, if the boot loader detects that there is valid code ready to just run, it waits before running this valid code to give the host a chance to "force" it into boot loader mode. The boot code waits 30 seconds (UART transport) or 50 usec (SPI transport) to receive a magic byte - see SB_FORCE_BOOT and SB_FORCE_RUN in sb_exec.h and look how they are used.

     

  • Hello,

    I have been looking at this boot code already and I understand you are right with respect to both possibilities can happen after powerup.  Then, the boot loader is going to wait some time and the user should choose between SB_FORCE_BOOT or SB_FORCE_RUN, ordering to run the boot process or the application respectively.

    However what I would like is that when the user has chosen to start the application with SB_FORCE_RUN, and meanwhile the application is running, the user could have the chance to order the boot code to start. But I don't know if this is possible, as I have attempted and I couldn't get it, so that's why I am really interested in knowing if you think this is possible in terms of software.

    Thank you very much,

    Lucía

  • Write the checksum at address HAL_SB_CRC_ADDR to 0x0000 and reset the device. Then sbImgValid() will fail and the boot loader will be forced into boot mode.

  • Hello,

    Thank you for your last post, I think it is a good idea.

    I wonder if the following code is enough for achieving it.

      uint16 crc[2];
      HalFlashWrite((HAL_SB_CRC_ADDR / HAL_FLASH_WORD_SIZE),(uint8*)crc,0);
      SystemResetSoft();

    I would like to know your opinion,

    BR,

    Lucía