EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

Cortex M0 vs. M3

Started by Tim Wescott February 8, 2014
I just noticed that the tool chain I'm using (arm-none-eabi from 
Codesourcery, version 4.6.3), does not seem to know what to do if I 
specify the M0 core to the compiler.

Does anyone in the collected group know if setting the processor to M3 
works?  Or is there some magic instruction that may get invoked and mess 
me up?

Alternately, since that tool set version is dated from March of 2012, 
does anyone know if the up-to-date version has explicit M0 support?

Thanks.

-- 
Tim Wescott
Control system and signal processing consulting
www.wescottdesign.com
On 2/8/2014 10:33 AM, Tim Wescott wrote:
> I just noticed that the tool chain I'm using (arm-none-eabi from > Codesourcery, version 4.6.3), does not seem to know what to do if I > specify the M0 core to the compiler. > > Does anyone in the collected group know if setting the processor to M3 > works? Or is there some magic instruction that may get invoked and mess > me up? > > Alternately, since that tool set version is dated from March of 2012, > does anyone know if the up-to-date version has explicit M0 support? > > Thanks. >
Here is how NXP explains it. https://www.youtube.com/watch?v=G2qG3teMj90
On Sat, 08 Feb 2014 11:13:51 -0700, hamilton wrote:

> On 2/8/2014 10:33 AM, Tim Wescott wrote: >> I just noticed that the tool chain I'm using (arm-none-eabi from >> Codesourcery, version 4.6.3), does not seem to know what to do if I >> specify the M0 core to the compiler. >> >> Does anyone in the collected group know if setting the processor to M3 >> works? Or is there some magic instruction that may get invoked and >> mess me up? >> >> Alternately, since that tool set version is dated from March of 2012, >> does anyone know if the up-to-date version has explicit M0 support? >> >> Thanks. >> > Here is how NXP explains it. > > https://www.youtube.com/watch?v=G2qG3teMj90
I hate to be ungrateful, but if there's a print version of that it would be helpful. Multimedia presentations just go in one ear and out the other for me. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
On 2/8/2014 11:18 AM, Tim Wescott wrote:
> On Sat, 08 Feb 2014 11:13:51 -0700, hamilton wrote: > >> On 2/8/2014 10:33 AM, Tim Wescott wrote: >>> I just noticed that the tool chain I'm using (arm-none-eabi from >>> Codesourcery, version 4.6.3), does not seem to know what to do if I >>> specify the M0 core to the compiler. >>> >>> Does anyone in the collected group know if setting the processor to M3 >>> works? Or is there some magic instruction that may get invoked and >>> mess me up? >>> >>> Alternately, since that tool set version is dated from March of 2012, >>> does anyone know if the up-to-date version has explicit M0 support? >>> >>> Thanks. >>> >> Here is how NXP explains it. >> >> https://www.youtube.com/watch?v=G2qG3teMj90 > > I hate to be ungrateful, but if there's a print version of that it would > be helpful. Multimedia presentations just go in one ear and out the > other for me. >
http://blogspot.tenettech.com/?p=2720 I like that video as it shows the instruction sets for the different processor versions. The M0 is a mini M3 which is a mini M4. So a binary for an M0 will run on a M4. But not the other way around. So the bottom line for you is; No the M3 compiler will not work with the M0 as not all the registers will be available. hamilton
On Sat, 08 Feb 2014 11:33:17 -0700, hamilton wrote:

> On 2/8/2014 11:18 AM, Tim Wescott wrote: >> On Sat, 08 Feb 2014 11:13:51 -0700, hamilton wrote: >> >>> On 2/8/2014 10:33 AM, Tim Wescott wrote: >>>> I just noticed that the tool chain I'm using (arm-none-eabi from >>>> Codesourcery, version 4.6.3), does not seem to know what to do if I >>>> specify the M0 core to the compiler. >>>> >>>> Does anyone in the collected group know if setting the processor to >>>> M3 works? Or is there some magic instruction that may get invoked >>>> and mess me up? >>>> >>>> Alternately, since that tool set version is dated from March of 2012, >>>> does anyone know if the up-to-date version has explicit M0 support? >>>> >>>> Thanks. >>>> >>> Here is how NXP explains it. >>> >>> https://www.youtube.com/watch?v=G2qG3teMj90 >> >> I hate to be ungrateful, but if there's a print version of that it >> would be helpful. Multimedia presentations just go in one ear and out >> the other for me. >> >> > http://blogspot.tenettech.com/?p=2720 > > I like that video as it shows the instruction sets for the different > processor versions. > > The M0 is a mini M3 which is a mini M4. > > So a binary for an M0 will run on a M4. > But not the other way around. > > So the bottom line for you is; No the M3 compiler will not work with the > M0 as not all the registers will be available.
Thanks. I knew that the M0 instruction set was a subset of the M3's, which was why I was concerned. Your link didn't help me by itself, but it did lead me down a path that ended with me finding the right options for the compiler I have, which certainly seem to be generating correct code. My Google-fu just needed jumper cables this morning. -- Tim Wescott Wescott Design Services http://www.wescottdesign.com
Tim Wescott schreef op 08-Feb-14 6:33 PM:
 > I just noticed that the tool chain I'm using (arm-none-eabi from
 > Codesourcery, version 4.6.3), does not seem to know what to do if I
 > specify the M0 core to the compiler.

Funny, I have been using the CodeSourcery compiler for M0 for over a 
year with -mcpu=cortex-m0

There was a problem with the aeabi library (long long arithemetic etc.), 
which used M3 instructions. Maybe that has been solved by now.

Wouter

We used the Keil tool chain. You can setup the compiler to use the M0 instruction set exclusively, assuring portability

Cheers

Klaus
On 2/8/2014 1:50 PM, Tim Wescott wrote:
> On Sat, 08 Feb 2014 11:33:17 -0700, hamilton wrote: > >> On 2/8/2014 11:18 AM, Tim Wescott wrote: >>> On Sat, 08 Feb 2014 11:13:51 -0700, hamilton wrote: >>> >>>> On 2/8/2014 10:33 AM, Tim Wescott wrote: >>>>> I just noticed that the tool chain I'm using (arm-none-eabi from >>>>> Codesourcery, version 4.6.3), does not seem to know what to do if I >>>>> specify the M0 core to the compiler. >>>>> >>>>> Does anyone in the collected group know if setting the processor to >>>>> M3 works? Or is there some magic instruction that may get invoked >>>>> and mess me up? >>>>> >>>>> Alternately, since that tool set version is dated from March of 2012, >>>>> does anyone know if the up-to-date version has explicit M0 support? >>>>> >>>>> Thanks. >>>>> >>>> Here is how NXP explains it. >>>> >>>> https://www.youtube.com/watch?v=G2qG3teMj90 >>> >>> I hate to be ungrateful, but if there's a print version of that it >>> would be helpful. Multimedia presentations just go in one ear and out >>> the other for me. >>> >>> >> http://blogspot.tenettech.com/?p=2720 >> >> I like that video as it shows the instruction sets for the different >> processor versions. >> >> The M0 is a mini M3 which is a mini M4. >> >> So a binary for an M0 will run on a M4. >> But not the other way around. >> >> So the bottom line for you is; No the M3 compiler will not work with the >> M0 as not all the registers will be available. > > Thanks. I knew that the M0 instruction set was a subset of the M3's, > which was why I was concerned. > > Your link didn't help me by itself, but it did lead me down a path that > ended with me finding the right options for the compiler I have, which > certainly seem to be generating correct code.
For my own records. Please post the links you found. Thanks hamilton
> > My Google-fu just needed jumper cables this morning. >
On Sat, 08 Feb 2014 23:14:49 +0100, Wouter van Ooijen wrote:

> Tim Wescott schreef op 08-Feb-14 6:33 PM: > > I just noticed that the tool chain I'm using (arm-none-eabi from > > Codesourcery, version 4.6.3), does not seem to know what to do if I > > specify the M0 core to the compiler. > > Funny, I have been using the CodeSourcery compiler for M0 for over a > year with -mcpu=cortex-m0 > > There was a problem with the aeabi library (long long arithemetic etc.), > which used M3 instructions. Maybe that has been solved by now.
I had been misinterpreting the correct behavior that I saw reflected in the map file as a problem. It was my own paranoia coupled with ignorance. The ignorance has been solved, which has allowed me to suppress the paranoia. -- Tim Wescott Control system and signal processing consulting www.wescottdesign.com
Tim Wescott schreef op 09-Feb-14 1:05 AM:
> I had been misinterpreting the correct behavior that I saw reflected in > the map file as a problem. > > It was my own paranoia coupled with ignorance. The ignorance has been > solved, which has allowed me to suppress the paranoia.
Does 64-bit (long long) arithemetic work OK? Wouter

The 2024 Embedded Online Conference