This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RA2E2 Setting the Options Function Select Register in Assembly

Hello,

we are programming for various reasons still quite "old school" in assembly and had to switch from AVR and PIC to ARM (Renesas RA2E2)

As development environment we use Keil µVison for this project. Unfortunately we have a problem and don't know how the Option Function Select Register can be set (OFS0 and) OFS1). These registers can apparently not be loaded in the main program after the reset, but must be set before.

Does anyone know if and how I can define them assembler. For example, can I use the AREA command to store data at a specific location in the memory or is it possible via a Scatter Files oder Linker Control String so that the programmer sets this two registers directly during flashing?

Many thanks in advance.

Best regards,

Sascha

Parents
  • I have a found a solution with the IAR Embedded Workbench by defining the region in the linker file.

    define region OSF1_REGION = mem:[from 0x00000404 to 0x00000407];
    
    place in OSF1_REGION { section OSF1_SECTION };

    And by using the #pragma definition for the variable in the C-Code:

    #include <stdint.h>
    
    #pragma location="OSF1_SECTION"
    
    __root const uint32_t OFS1_VALUE = 0xFFFFAFFF;

    Perhaps there is a similar approach for µVision?

    Regards,

    Sascha

Reply
  • I have a found a solution with the IAR Embedded Workbench by defining the region in the linker file.

    define region OSF1_REGION = mem:[from 0x00000404 to 0x00000407];
    
    place in OSF1_REGION { section OSF1_SECTION };

    And by using the #pragma definition for the variable in the C-Code:

    #include <stdint.h>
    
    #pragma location="OSF1_SECTION"
    
    __root const uint32_t OFS1_VALUE = 0xFFFFAFFF;

    Perhaps there is a similar approach for µVision?

    Regards,

    Sascha

Children
No data