This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Feature Request for halcogen

Other Parts Discussed in Thread: HALCOGEN

I has some idea.

Halcogen must generate header file with configuration settings. For sample  - stack sizes, clock settings, CAN, UART settings etc...

This file can be generated from dil file. For sample

#define ARCH TMS570LS1224PGE
#define DRIVER_SYSTEM_VAR_RAM_STACK_ABORT_LENGTH_VALUE 0x00000100


  • Hi Vladimir,

      In HalCoGen under the RAM tab you can specify the stack base address and length for each CPU mode. Please see below. Please find below example.

  • Charles,

    Yes I can specify stack size in halcogen. But I want later read this value in code.

  • Hi Vladimir,
    Are you trying to find out the current stack pointer value in the mode you operate in or another mode? I'm not aware how this can be done dynamically in runtime. The Cortex-R processor can operate in different mode, i.e. user, FIQ, IRQ , supervisor, undefined and etc. Each mode will have its own stack pointer. You can't read another mode's stack pointer from your current operating mode.
  • This is my code to read stack pointers in realtime.

    	.data
    userSp  .word 0
    fiqSp   .word 0
    svcSp   .word 0
    irqSp   .word 0
    abortSp .word 0
    undefSp .word 0
    	.def   userSp
        .def   fiqSp
        .def   svcSp
        .def   irqSp
        .def   abortSp
        .def   undefSp
    
    	.text
    	.arm
    
        .def     _ReadStackPointers_
        .asmfunc
    _ReadStackPointers_
        cps   #17
    	LDR  R0, fiqSpConst
    	str  sp, [r0]
    
        cps   #18
    	LDR  R0, irqSpConst
    	str  sp, [r0]
    
        cps   #19
    	LDR  R0, svcSpConst
    	str  sp, [r0]
    
        cps  #23
    	LDR  R0, abortSpConst
    	str  sp, [r0]
    
        cps  #27
    	LDR  R0, undefSpConst
    	str  sp, [r0]
    
        cps   #31
    	LDR  R0, userSpConst
    	str  sp, [r0]
    
        bx    lr
    
        .endasmfunc
    
    userSpConst  .word userSp
    fiqSpConst   .word fiqSp
    svcSpConst   .word svcSp
    irqSpConst   .word irqSp
    abortSpConst .word abortSp
    undefSpConst .word undefSp