S32DSforPowerV2.1's ld option -nostartfiles does not work

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

S32DSforPowerV2.1's ld option -nostartfiles does not work

3,144 次查看
goodfriends
Contributor I

Hello, everyone, please ask a question. When I created the NXP5748G flashDrv RAM, I wanted to generate a position-independent code base. But I use S32 Design Studio for Power Architecture Version 2.1 to create an application project, this ld configuration option -nostartfiles does not work? Does anyone know how to configure and modify the ld file option?

Application Project Properties: Standard S32DS C/C++ Linker > General

thanks!

0 项奖励
回复
12 回复数

3,108 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

the -nostartfiles option tells the linker to do not use startup from STD C library. But you still need to use some startup to configure your MCU. 

 

Jiri

0 项奖励
回复

3,136 次查看
davidtosenovjan
NXP TechSupport
NXP TechSupport

Hi, there is an example for PIC, however for different platform.

https://community.nxp.com/t5/S32-Design-Studio-Knowledge-Base/EXAMPLE-S32K144-Position-Independent-C...

I will check whether PIC example for S32DS for Power exists.

0 项奖励
回复

3,132 次查看
goodfriends
Contributor I

thanks!  old project use 5744P and S32 Design Studio for Power Architecture Version 2017.R1 import S32 Design Studio for Power Architecture Version 2.1,create map file

 .startup        0x40030400        0x0

                0x40030400                __start = .

 *(.startup)

 

But I creat new 5748G and   S32 Design Studio for Power Architecture Version 2.1 , create map file

.startup        0x40030020      0x1ee

                0x40030020                __start = .

 *(.startup)

 .startup       0x40030020      0x1ee ./Project_Settings/Startup_Code/startup.o

                0x40030020                _start

                0x4003020a                _fini 

I Does not compile the startup.S, solved this problem.Did you know that this problem can be solved by configuring or modifying the ld file?

0 项奖励
回复

3,104 次查看
jiri_kral
NXP Employee
NXP Employee

Hi, 

to be honest - I don't get it. So, can you describe in more details what you are trying to do or what's your approach? 

 

Jiri

0 项奖励
回复

3,095 次查看
goodfriends
Contributor I

hi,thanks!

My purpose is to use S32 Design Studio for Power Architecture Version 2.1 to compile the C55_JDP_SSD.exe flash driver file to generate a single-block *.Srec, and then use hexview.exe to export the C language array method, and put the C language array content in RAM , It is used for erasing 5748GMCU flash, but the srec file generated by my new project is multi-block. If startup.S is not compiled, a single-block can be generated.5748G SREC文件5748G SREC文件

image.png

 

0 项奖励
回复

3,077 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

I do not understand why to compile the drivers again. The package already contains pre-compiled drivers either in c-array format or in s-record format. If you want to have single package of the functions, you can simply concacenate them without changes.

Regards,

Lukas

0 项奖励
回复

3,061 次查看
goodfriends
Contributor I

hi,We need to provide customers with a packaged flash erasing function and a separate serc format file, which is convenient for the host computer to download to the ram erasing flash, so we need to recompile the *.C file of c-array_driver to form a file, and NXP provides the driver Srec is a single file that is not convenient for customers to download.

0 项奖励
回复

3,002 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Let me confirm if I can understand it - you just need to have our SSD drivers in single file, correct? Do you need it as single s-record file or as single c-array?

Regards,

Lukas

0 项奖励
回复

2,971 次查看
goodfriends
Contributor I

Hi,correct. My purpose is to use S32 Design Studio for Power Architecture Version 2.1 to compile the C55_JDP_SSD.exe flash driver *.c file to generate a single-block *.Srec for nxp 5748G.

thanks!

0 项奖励
回复

2,943 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Hi,

take a look at attached files. One version is generated for s-record base address 0x0, second for 0x40000000. Not sure which one is better for you. Offsets for individual functions can be found in the excel file.

Hope it helps.

Regards,

Lukas

0 项奖励
回复

2,935 次查看
goodfriends
Contributor I

thanks ! The file you gave is what I need, but my starting address is 0x40030000, can you give me your project file or tell me the configuration steps to generate a single-block srec file?

0 项奖励
回复

2,930 次查看
lukaszadrapa
NXP TechSupport
NXP TechSupport

Attached. I wrote very simple script for Lauterbach debugger to load the individual files to RAM and then I saved the content of that area to s-record file with specified offset. This is much easier (from my point of view, at least) than playing with S32DS...

Regards,

Lukas

0 项奖励
回复