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.

Loop in HalCoGen generated code - sys_memory.asm - RAM initialization mask

Other Parts Discussed in Thread: HALCOGEN, TMS570LS3137

Hello,

I'm trying to run my HalCoGen project, but when I start it, it stay in loop in the code below, the "beq mloop" always jumps to mloop , so the test is never true.

_memoryInit_

ldr r12, regMinitGcr ; MINITGCR register pointer
mov r4, #0xA
str r4, [r12]
ldr r4, ramInitMask ; load RAM initialization mask
str r4, [r12, #4]
mloop
ldr r5, [r12, #12]
tst r5, #0x100
beq mloop
ramInitMask   dcd 0x1E57F
regMinitGcr dcd 0xFFFFFF5C
comparing with the Demo, changing ramInitMask   to 0x457F worked. 
A pseudo-code with the registers names help to unterstand what is being done.
MINITGCR <= 0xA ; enable memory init
MSINENA <= 0x1E57F/ 0x457F ; 
while ( MSTCGSTAT & 0x8 ) wait; reads MINIDONE until memory is ready.

The documentation does not leave clear what the MSINENA does, just that in case of MINITGENA = Ah, Memory module initialization is disable.

I would like to unterstand better the values in the MSINENA register, and where I can change the "ramInitMask " in HalCoGen.

Thanks
  • Can you please tell us which device you are using? TMS570LS3137 or RM48?

    If you use RM48, you need to clear bit 14 for MSINENA. Bit 14 is for FlexRay TU, but RM48 doesn't support FlexRay. Please try 0x1C57F.

    Regards,

    QJ

  • Hello,

    Thanks for the quick answer.

    I'm using RM48, the HDK.

    The 0x1C57F didn't work.

    I realized that the  0x457F also didn't worked, it worked only after I runned the Demo before, but reseting ( powering down ) the processor make it stays on loop. I'm missing something in HalCoGen ? I haven't touched nothing yet hoping that default config would work, 

    For what I can suppose the value for ramInitMask is built based on the devices I'm using according to table 2-16 of the RM48 - Technical Reference Manual.

    thanks,

    Cristiano

  • Hi Cristino,

    I just tried 0x1c57f, and 0x457f on my RM48 HDK, both works fine. Please try the blinky CCS project from TI WIKI page

    http://processors.wiki.ti.com/images/5/5b/RM48_HDK_Sample_Code.zip

    Regards,

    QJ

  • Hello QJ Wang.

    The Sample Code worked. The blinky sample also worked on iar.

    But using identical .asm don't works. I'm having problem with the interrupt vector also, don't no if there is any relation. 

    What can influence the values in ramInitMask and what can make MSTCGSTAT : MINIDONE don't be ready ???

    There is anything I have to turn on or turn off before memory initialization ?

    Thanks,

    Cristiano