Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 6 of 6

Thread: How can I acess the core register of the ARM?

  1. #1
    Junior Member
    Join Date
    Aug 2017
    Posts
    19

    How can I acess the core register of the ARM?

    Hello guys,

    how can I acess or change the core registers of the ARM? Im trying to use the CMSIS fncions like __set_PRIMASK() but I always get "the was not declared in this scope" error.

    Is it possible to acess the registers using this functions? What do I need to change to make it happen? Or is there a better way of changing the registers?

    I'm kinda new at this.

    Thank you,
    Artur Zorzol

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,153
    Similar functions are in kinetis.h.

    For this case, use __disable_irq() and __enable_irq().

  3. #3
    Junior Member
    Join Date
    Aug 2017
    Posts
    19
    Thank you Paul, ill definitely check that. But I'm a little bit confused, why doesn't the cmsis functions, described on the ARM's website, work for the board? Shouldn't they work with any ARM processor?

  4. #4
    Senior Member+ Theremingenieur's Avatar
    Join Date
    Feb 2014
    Location
    Colmar, France
    Posts
    1,770
    The CMSIS functions work definitively on the Teensy, you can use them in ASM() as it is for example done in the dspinst.h file which is part of the audio library.

    What does not work by default are these function macro wrapper which start on two underscores like __set_PRIMASK(). These aren't the functions themselves but just wrappers for easier use which the ARM/KEIL environment (which uses the IAR compiler) adds for the convenience of some developers.

    Paul decided to include something similar in his kinetis.h file as he explained above. Thus both ways, the one in the Keil IDE, the other in the Teensyduino IDE, are equivalent, it's like two different dialects of the same language.

  5. #5
    Junior Member
    Join Date
    Aug 2017
    Posts
    19
    Perfect, got it. Thank you very much

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    18,153
    We I started Teensy 3.0 in 2012, CMSIS was very new and not very stable. Since then, ARM made numerous incompatible changes. Things seem to have settled down now, so perhaps at some point we'll add CMSIS support. But Teensy's main goal is API compatibility with Arduino. Most of my dev time time goes into Arduino libs & features. CMSIS just isn't a priority.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •