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.

TM4C123GH6PM: How to solve the errors caused by compiling bootloader with IAR?

Part Number: TM4C123GH6PM

Hi all:

My project needs to be used to boot loader, so I first use IAR to compile boot loader source code.

But a compilation error occurred because the MAIN function could not be found. 

Details of errors and project files are shown below.  

To solve this problem, modify the compilation configuration or add the MAIN function to bootloader according to my own requirements? 

Thansk a lot!

  • Hello Alex,

    I am not experienced with IAR and you may need to get support from IAR to solve this but I can say the following:

    1) You cannot add a main function to the boot loader, that is not how it works, the main function exists in the code you upload, not the boot loader
    2) You may need to look at linker settings, for CCS one of the main project differences is the boot loader doesn't have a Linker file.
    3) Have you tried importing a TivaWare boot loader example like boot_serial? This would let you see the correct IAR project setting so you can compare the two.

    You may need to ask IAR what setting allows the lack of main function to be ignored.
  • Hi Ralph Jacobi:

    Thanks for your reply. I have another question. I hope you can answer it.

    I'm going to use CAN for boot loader. I have read the document:SPMU301D. I hope to upgrade in my application. So I have to call functions in my application:AppUpdaterCAN. To implement the call to AppUpdater CAN in my application, I must also integrate the boot loader source code with my application to compile?

    Thank you very much!
  • Hello Alex,

    You will load two firmwares onto your device. First you load the Flash boot loader configured for CAN boot loading. Then you flash your application firmware which includes the AppUpdaterCAN API. Sorry, need to correct myself, you don't call AppUpdaterCAN in your application, you call JumpToBootLoader or something equivalent. You can see JumpToBootLoader in projects like boot_demo1.

    The application firmware doesn't need the boot loader source code integrated in it, you just need to be sure that the boot loader is flashed into memory and the application firmware can invoke the boot loader when needed.