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

supervisor mode

Hello,

is it quite normal, that a arm9 microcontroller starts in the supervisor mode? How could I changed the mode into user mode? Or is it better to work in the supervisor mode?

I've only the startup file and a short main.c file

#include <stdio.h>

int main(void)
 {

 while(1);

}

In the startup file I only can see that every mode will be initialized.

best regards
tobi

  • It has already been explained to you. The processor always starts in it's toughest mode.

    It needs to process instructions that tells it to enter user mode. With a broken scatter file, the application startup code is not run, so no instruction switches the processor into the user mode.

  • It has already been explained to you. The processor always starts in it's toughest mode.

    Yes I know that there must be an explanation which defines the user mode. And now I understand why it is not working in the user mode, because I never enterd the startup code file (because I have not installed a suitable section for it...) -> thanks for your answer - now it is clear for me.

    Which sections are recommend to install in such a scatter-file? I have one section for the external flash (with the startup-code included), one section for the internal RAM and one section for the external RAM (only for the use of big structures and buffers from the peripherie).

    But is it for example recommend to install my own heap and stack size within the scatter-file - or the vector table (for data abort handler, undefined handler and so on)?

    How is it possible to install one section only for incomming data from all peripherials e.g. usart or usb. Do I have to install only a EMPTY section?

    ARM_SECTION 0x20000000 EMPTY 0x8000
    

    and now I'm able to say

    int *ptr_buffer = 0x20000000;
    

    tobi

  • Now I want to use two load regions - one for each storage (flash and internal ram) - but now I get the error
    No Algorithm found for: 00200000H - 0020000FH

    LOAD_FLASH 0x10000000 0xFFFFFF                     ; start address and length
    {
    
            EXTERN_FLASH 0x10000000
            {
                    *.o (RESET, +First)
                    *(+RO)
            }
    }
    
    LOAD_SRAM 0x00200000 0xFFFFF
    {
            INTERN_RAM 0x00200000
            {
                    *(+RW,+ZI)
            }
    }
    

    The internal RAM is from 0x00200000 to 0x002FFFFF.

    tobi

  • Now I get another stupid error - I have one section for one c-file (only +RW, +ZI) and the +RO data of this section where placed by the compiler to the default address 0x0000000. I thought that it would be enough to create one region with *(+RO) where all RO data would be stored????

    LOAD_FLASH 0x10000000 0xFFFFFF                     ; start address and length
    {
    
            EXTERN_FLASH 0x10000000 0xFFFFFF
            {
                    RM9200.o (RESET, +First)
                    *(+RO)
    
            }
    
            SRAM 0x20000000 0xFFFFFF
            {
                    timer.o (+RW,+ZI)
            }
    
            BUFFER_SRAM 0x21000000 EMPTY 0x2000000
            {
    
            }
    
            INTERN_RAM 0x200000 0xFFFFF
            {
                    *(+RW,+ZI)
            }
    }
    

    tobi

  • If I wrote

    timer.o (+RO)
    

    in the executing section EXTERN-FLASH

    I get the warning, that the compiler will removed unused sections (timer.o (RO)).

    But I want to have all RO data from the c-file timer.c within the external flash.

    tobi