[PATCH rtems 2/2] bsps/imxrt: Simplify linkcmds and make it flexible

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Jun 21 13:00:11 UTC 2021



On 19/06/2021 16:35, dufault at hda.com wrote:
> I'm getting back to this as I have the HyperRAM working so I'm trying to set up appropriate linker settings.
> 
>> On Jun 10, 2021, at 01:43 , Sebastian Huber<sebastian.huber at embedded-brains.de>  wrote:
>>
>> The initial stack needs to be in an accessible memory area. Currently it is placed in this linker output section:
>>
>> 	.rtemsstack (NOLOAD) : ALIGN_WITH_INPUT {
>> 		bsp_section_rtemsstack_begin = .;
>> 		*(SORT_BY_ALIGNMENT (SORT_BY_NAME (.rtemsstack*)))
>> 		bsp_section_rtemsstack_end = .;
>> 	} > REGION_WORK AT > REGION_WORK
>> 	bsp_section_rtemsstack_size = bsp_section_rtemsstack_end - bsp_section_rtemsstack_begin;
>>
>> Maybe we should place the .rtemsstack.interrupt input section into the REGION_VECTOR memory region.
> On the "imxrt" REGION_VECTOR is in FLASH, at least ".vector' in the app I'm testing is at 0x6004653c which is in HyperFLASH.

Then place the .rtemsstack.interrupt input section into the REGION_STACK 
memory region and make sure REGIION_STACK is located in the OCRAM.
> 
> In HyperRAM I see these regions allocated:
> 
> REGION_DATA: .rwbarrier
> REGION_DATA_LOAD: .data, .rtemsrwset
> REGION_BSS: .bss
> REGION_WORK: .rtemsstack, .work
> REGION_STACK: .stack
> 
> So I put REGION_WORK in the OCRAM to get .rtemsstack out of HyperRAM to get started.  My application is now running out of HyperFLASH and HyperRAM though I'm sure I'll find issues.
> 
> - What's in "REGION_WORK"?  Does that have anything to do with the RTEMS work space?

Yes, the RTEMS Workspace and C Program Heap use this region.

> - What's the proper solution?  I don't particularly want to redo my HyperRAM initialization to avoid using stack since I'm calling some NXP functions.  I'd like a small amount of stack available in the context of bsp_start_hook_0() to set up the external RAM.
> - What's going on in the shared ARM _start with bsp_start_hook_0_done and the branch to bsp_start_hook_0()?

Some arm BSPs don't have a boot loader and relocate during startup from 
flash to RAM. See comment in start.S.

-- 
embedded brains GmbH
Herr Sebastian HUBER
Dornierstr. 4
82178 Puchheim
Germany
email: sebastian.huber at embedded-brains.de
phone: +49-89-18 94 741 - 16
fax:   +49-89-18 94 741 - 08

Registergericht: Amtsgericht München
Registernummer: HRB 157899
Vertretungsberechtigte Geschäftsführer: Peter Rasmussen, Thomas Dörfler
Unsere Datenschutzerklärung finden Sie hier:
https://embedded-brains.de/datenschutzerklaerung/


More information about the devel mailing list