.noInit Question

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

.noInit Question

1,195 Views
chadgraham
Contributor V

Hello,

I have a large array for an Ethernet interface for an RTOS implementation that I am trying to place into the SDRAM on a RT1060 dev kit.  I have broken the SDRAM into 2 pieces by isolating a portion of the memory to RAM5 (Location: 0x81C0 0000, Size: 0x20 0000, RAM5).  In my code, I have included <cr_section_macros.h> and have the array defined as __NOINIT(RAM5) uint16_t ClassName::array[SIZE].

If I remove the __NOINIT(RAM5) from the definition and use a definition of uint16_t ClassName::array[SIZE], the application runs without issues and continuously responds to pings.    If I leave the __NOINIT(RAM5), then the program works for about a second (3-4 pings) before it just stops responding.  The thread is still active and the system does not report any issues so I am assuming it has something to do with the array location.

I am successfully using the RAM at a different location so I can verify that the SDRAM is initialized and running.  Additionally, this is the only thing that has been assigned to this new memory region so it isn't corruption from a different thread or data set.

Does anyone have any suggestions?

Labels (1)
0 Kudos
5 Replies

1,085 Views
converse
Senior Contributor V

Ok, I understand what you are doing now.

i don’t think that the NOINIT is causing you problem. I’d take a look at you SDRAM init code. You also need to debug your application to see what it is doing when it stops responding.

0 Kudos

1,085 Views
converse
Senior Contributor V

What are you actually trying to achieve by using NOINIT?

0 Kudos

1,085 Views
chadgraham
Contributor V

converse

I am trying to allocate a region of memory for the packet pool.  

#define NX_PACKET_POOL_SIZE ((1536 + sizeof(NX_PACKET)) * 50)

__NOINIT(RAM5) ULONG ClassName::packet_pool_area[NX_PACKET_POOL_SIZE/4 + 4];

0 Kudos

1,085 Views
converse
Senior Contributor V

Have you tried __BSS?

0 Kudos

1,085 Views
chadgraham
Contributor V

converse

Hello,

Yes, I tried both __DATA and __BSS, but they produce a seg fault when I start the application.  My understanding is that the SDRAM must be initialized before it can be accessed.‌

Active faults
Bus Fault (BFSR)
IMPRECISERR (2) Imprecise data bus error
Hard Fault (HFSR)
FORCED (30) Indicates a forced hard fault, generated by escalation of a fault with configurable priority that cannot be handled, either because of priority or because it is disabled

Fault Status Registers
IPSR 0x00000003 Exception Status Register (Hard Fault)
CFSR 0x00000400 Configurable fault Status Register
MMSR 0x00000000 Memory Manage fault Status Register
BFSR 0x00000004 Bus fault Status Register
UFSR 0x00000000 User fault Status Register
HFSR 0x40000000 Hard fault Status Register
DFSR 0x00000000 Debug fault Status Register
MMAR 0x00000000 Memory Manage fault Address Register
BFAR 0x00000000 Bus fault Address Register
ABFSR 0x00000208 Auxiliary Bus Fault Status Register

Stacked Registers (MSP LR/EXC_RETURN=0xfffffff9)
R0 0x81C00048
R1 0x000137C8
R2 0x00000000
R3 0x00000048
R12 0x000001FE
LR 0x600023B5 data_init(unsigned int, unsigned int, unsigned int)() @ \<Removed>\startup\startup_mimxrt1062.cpp line 614
PC 0x600023F2 bss_init(unsigned int, unsigned int)() @ \<Removed>\startup\startup_mimxrt1062.cpp line 626
PSR 0x81000000
MSP 0x2001FFD8

0 Kudos