Author Topic: MCUXpresso, change default entry.  (Read 2269 times)

0 Members and 1 Guest are viewing this topic.

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
MCUXpresso, change default entry.
« on: July 17, 2018, 05:13:31 pm »
 
Hello

I 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.

 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: MCUXpresso, change default entry.
« Reply #1 on: July 17, 2018, 05:16:44 pm »
Just open your startup file and write whatever function name you like on the vector table.
Alex
 

Offline vidi

  • Contributor
  • Posts: 24
  • Country: sk
Re: MCUXpresso, change default entry.
« Reply #2 on: July 17, 2018, 08:20:16 pm »
Hello,

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?

Please 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.html

But 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.

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.

It's simple. IAR has the biggest portion on the market. It is the most used toolchain of ARM embedded world (followed by KEIL).
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11260
  • Country: us
    • Personal site
Re: MCUXpresso, change default entry.
« Reply #3 on: July 17, 2018, 08:22:51 pm »
But 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.
Of 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.

Alex
 

Offline vidi

  • Contributor
  • Posts: 24
  • Country: sk
Re: MCUXpresso, change default entry.
« Reply #4 on: July 17, 2018, 09:42:09 pm »
Of course it does not. The only way to actually change the entry point is to change the vector table.

Nope. 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.pdf

Quote
Use this option to make a symbol be treated as a root symbol and the start label of the
application. This is useful for loaders. If this option is not used, the default start symbol
is __iar_program_start. A root symbol is kept whether or not it is referenced from
the rest of the application, provided its module is included. A module in an object file is
always included and a module part of a library is only included if needed.

What 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.
« Last Edit: July 17, 2018, 09:49:24 pm by vidi »
 

Offline ehughes

  • Frequent Contributor
  • **
  • Posts: 409
  • Country: us
Re: MCUXpresso, change default entry.
« Reply #5 on: July 18, 2018, 12:45:58 pm »
Quote
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.

Because 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.   



   
 

Offline luiHSTopic starter

  • Frequent Contributor
  • **
  • Posts: 592
  • Country: es
Re: MCUXpresso, change default entry.
« Reply #6 on: July 20, 2018, 09:15:09 am »
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.
"
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf