Update start up file based on build configuration (Release or Debug)

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

Update start up file based on build configuration (Release or Debug)

1,379 次查看
saireddy_saredd
Contributor III

Hallo 

I am working with S32K14x micro controlles.

I want to enable or disable the JTAG interface. So, want to manipulate the Flash section in start up file.
Is it possible to manipulate the start-up file based on the build configuration?

 

 

/* Flash Configuration */
    .section .FlashConfig, "a"
    .long 0x01234567     /* 8 bytes backdoor comparison key           */
    .long 0x89ABCDEF     /*                                           */
    .long 0xFFFFFFFF     /* 4 bytes program flash protection bytes    */

//Only applicable for DEBUG configuration
#ifndef RELEASE_CONFIG
/* Flash Configuration */
    .long 0xFFFF7FBF     /* FDPROT:FEPROT:FOPT:FSEC(0xBF = backdoor active, MCU secured) */
#else //For DEBUG configuration
    .long 0xFFFF7FFE     /* FDPROT:FEPROT:FOPT:FSEC(0xFE = unsecured) */
#endif

 

 

Best Regards,

Saidhi reddy Sareddy

0 项奖励
回复
3 回复数

1,334 次查看
saireddy_saredd
Contributor III

Hi Vane

 

Thank you very much for the information,

Is it possible to write on these locations 0x400 to 0x400C with flash functions using SDK instead of the start-up code.(I will make sure write only once with some eeprom flags)

I did not find the direct functions in SDK.

 

0 项奖励
回复

1,319 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @saireddy_saredd 

Function Name : FLASH_DRV_Program() program 4 consecutive bytes (for program long word command) and 8 consecutive bytes (for program phrase command) on P-Flash or D-Flash block. This API always returns STATUS_SUCCESS if size provided by user is zero regardless of the input validation.

You can see how this function is used in the flash_partitioning_s32k1xx example.

0 项奖励
回复

1,359 次查看
VaneB
NXP TechSupport
NXP TechSupport

Hi @saireddy_saredd 

It is possible to manipulate the startup code to enable/disable the JTAG interface.

I suggest you look at the following application notes, which be useful for you.

 

B.R.

VaneB

0 项奖励
回复