MCUXpresso, change default entry. - Page 1
Forum section: electronics / general

author: luiHS
author_rank: Frequent Contributor
timestamp: July 17, 2018, 05:13:31 pm
content: HelloI am following the instructions in Application Notes AN12107 and AN12108 from NXP to start the program on RT1020 and RT1050 evaluation boards. The problem is that NXP put all the examples with IAR instead of with MCUXpresso.In step 2 of the instructions, they put "Change the default entry to Reset_Handler likes following Figure", the problem is that I do not find this option in MCUXpresso. Does anyone know?In general, I do not understand the NXP policy, they have their own free development environments like MCUXpresso, but when they make manuals they put all the examples for commercial development tools like IAR or others, this does not make sense.

author: ataradov
author_rank: Super Contributor
timestamp: July 17, 2018, 05:16:44 pm
content: Just open your startup file and write whatever function name you like on the vector table.

author: vidi
author_rank: Contributor
timestamp: July 17, 2018, 08:20:16 pm
content: Hello,Quote from: luiHS on July 17, 2018, 05:13:31 pmPlease open the linker script file (something.ld) and set "ENTRY(your function)"https://ftp.gnu.org/old-gnu/Manuals/ld-2.9.1/html_node/ld_24.htmlBut honestly, it doesn't make sense. The ENTRY set a special attribute/symbol in output .out/.elf - to by used later by OS elf loader. But there is none, it is a baremetal. And according to app note, no utility use/parse the .out/.elf output further.Quote from: luiHS on July 17, 2018, 05:13:31 pmIt's simple. IAR has the biggest portion on the market. It is the most used toolchain of ARM embedded world (followed by KEIL).

author: ataradov
author_rank: Super Contributor
timestamp: July 17, 2018, 08:22:51 pm
content: Quote from: vidi on July 17, 2018, 08:20:16 pmOf course it does not. The only way to actually change the entry point is to change the vector table.I'm not sure if IAR setting actually does this, or does the same as ENTRY() in the linker script. If it is the latter, then why bother?And may be when you look at the vector table, you will find a better way to set it, already provided by the vendor. I have no idea how NXP's startup code looks like.

author: vidi
author_rank: Contributor
timestamp: July 17, 2018, 09:42:09 pm
content: Quote from: ataradov on July 17, 2018, 08:22:51 pmNope. It is definitely true for small microcontrollers like CortexM3/M4. You set up vector table location to match the default value of VTOR register, so MCU can handle interrupts immediately after power on. But not in case of iMX. There is a first stage ROM bootloader that parse IVT header (binary blob, offset depends on medium - SDCARD, QuadSPI, ...) and jumps to location pointed by "entry" member of IVT. So hard reset will cause the bootloader run again and handle the basic HW setup itself.The IAR "entry" field generates "--entry" flag on CLI. According to doc, it:http://supp.iar.com/FilesPublic/UPDINFO/004916/arm/doc/EWARM_DevelopmentGuide.ENU.pdfQuoteWhat I don't understand on the APP note is why they generate .srec binary (loose memory/symbols info) and use some external memory layout again that must match the application.

author: ehughes
author_rank: Frequent Contributor
timestamp: July 18, 2018, 12:45:58 pm
content: QuoteBecause the app notes are 1st written for the customers who were often participating in the alpha/beta tests. These customers are purchasing a *lot* of the parts and more often than not use commercial tools. The "Freescale" side of NXP (Kinetis, i.MX RT) almost always do initial development with IAR.

author: luiHS
author_rank: Frequent Contributor
timestamp: July 20, 2018, 09:15:09 am
content: Thanks to everyone for your replies.NXP respond to me about the question "Change the default entry to Reset_Handler", and it seems that it is not important and is not necessary for MCUXpresso. I will try it as soon as I receive the new board that I ordered, because the previous one was burned when using Jlink.They also explain why most of the application notes are with examples of commercial tools such as IAR, although this answer does not convince me because it does not respond why the Application Notes are made with commercial tools instead of with MCUXpreso that is free. The explanation of ehughes is more reasonable."you can skip this step in MCUXpresso. As you may notice the initialization routine in startup files is different in IAR and MCUXpresso, so you may skip this step without problems.Please note NXP provides MCUXpreeso as a free option for our costumers and it is not intended to compete with other non-free and powerful tools such as out partner IAR. This is why you may find documentation in IAR and MCUXpresso as well."