S32K342 CAN bootloader sample code implement problem

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

S32K342 CAN bootloader sample code implement problem

跳至解决方案
18,910 次查看
HarrySu
Contributor II

Hello NXP, @nxf10035 

Sorry, I have deleted that comment.

I am working on S32K342 CAN bootloader,I have refered the sample code S32K344_CAN_Bootloader_RTD2d0 in

https://community.nxp.com/t5/S32K-Knowledge-Base/Unified-bootloader-Demo/ta-p/1423099

, but I got the complier error below, Mcal.h didn't exist in my project, How can this problem be resolved? My IDE is RTD v2.0.3. Thanks!

HarrySu_0-1686709001698.png

1 解答
18,868 次查看
nxf10035
NXP Employee
NXP Employee

Hi,

     It's might be compatibility problem of RTD2.0 with RTD2.0.3. Suggestion you can

1. create another project over RTD2.0.3

2. Configure peripherals reference bootloader project

3. Copy all bootloader code including link file to new project without RTD and generate code

4. Compare two projects and new project code should the same with old project

5. C40_IP.c should follow old project

BR 

Tomlin

在原帖中查看解决方案

0 项奖励
回复
32 回复数
6,465 次查看
HarrySu
Contributor II

Hello Tom @nxf10035 ,

Do you mean the Linker file of S32K342 should overwire by Linker file of S32K3X2 series MCU sample code? Thanks!

HarrySu_0-1687933440959.png

BR

Harry

0 项奖励
回复
6,470 次查看
nxf10035
NXP Employee
NXP Employee

Hi, @HarrySu 

     S32K322 and S32K342 is same P-Flash size, TCM size etc. Unfortunately, we just have the sample code for S32K312. The P-Flash size is the same with S32K42. DTCM and ITCM size only half of S32K342/S32K322. Detail information you can reference attachment(excel) in RM. Suggestion you reference the bootloader code and link file of S32K312. You can set the same segments in link file. DTCM and ITCM size should follow keep default.

BR

Tomlin

6,414 次查看
HarrySu
Contributor II

Hello Tom @nxf10035 ,

I followed your suggestion, config refer S32K312.

Also, I replace the S32K342 flash&ram linker file with S32K312 linker file, values of DTCM and ITCM from S32K342 are preserved to default .It can build succesfully, but the debuger shut down when programming, It says:

BusFault: An imprecise (asynchronous) data access error has occurred.
HardFault: A fault has been escalated to a hard fault.

If I didn't change linker file, it can programming successfully, but program also block in Hardfault while in boot power check function.

Did I make any mistakes in the above steps of modifying the memory?

HarrySu_1-1688001467982.png

 

HarrySu_0-1688001395110.png

BR,

Harry

0 项奖励
回复
6,365 次查看
nxf10035
NXP Employee
NXP Employee

Hi, @HarrySu 

    Did you compare the source code of S32K312 and S32K324? As following is the boot configuration in  boot_cfg.c of S32K312.

nxf10035_0-1688017079835.png

BR 

Tomlin

0 项奖励
回复
6,190 次查看
HarrySu
Contributor II

Hello Tom @nxf10035 ,

My bootinfo is same like yours in S32K342 project, Thanks!

HarrySu_0-1688017587475.png

BR 

Harry

0 项奖励
回复
4,167 次查看
JonAnder_Amante
Contributor II

Hi,

I have a question about "tbootInfo". Could you tell me what is the meaning of the different parts of the structure because I want to use "requestBackdoor" of the bootloader. I want that the bootloader waits a little time to enter to application but I have different errors. 

 

Thank you,

0 项奖励
回复
6,035 次查看
nxf10035
NXP Employee
NXP Employee

Hi, @HarrySu 

    Please compare other source code. If you found all the code are same. You can share the project to me.

BR 

Tomlin

0 项奖励
回复
5,946 次查看
HarrySu
Contributor II

Hello Tom @nxf10035 ,

Did you mean compare following source code file? Entire file were copied from S32K312 sorce code file.

HarrySu_0-1688023967500.png

Due to our company policy, I am unable to upload or send the code. I was wondering if it would be possible to schedule a meeting with you to go through my code together. I'm not sure if Tom is available for this. If we can communicate in Chinese, it would be easier for me to express. Thank you!

 

0 项奖励
回复
4,249 次查看
nxf10035
NXP Employee
NXP Employee

Hi, @HarrySu 

     OK, please attach your working E-mail. I can booking a meeting in teams today.

BR 

Tomlin

0 项奖励
回复
4,247 次查看
HarrySu
Contributor II

Hello Tom @nxf10035 ,

Very appreciate your support, I use my personal desktop build a same project, link is below.

This code environment RTD version is 2.0.0. You could check my code first.

https://drive.google.com/drive/folders/1JgfxQVwPwU1e2_RLpwEiq6upSFTuNh_D?usp=sharing

My work email is HARRY.WC.SU@cyntec.com

I am free all day today. Thank you once again for your help.

 

Best Regards,

Harry

0 项奖励
回复
4,379 次查看
HarrySu
Contributor II

Hello Tom @nxf10035 ,

I have checked the MCU program block in bootloader Initial stage

BOOTLOADER_MAIN_Init -> Boot_PowerONClearALLFlag->HardFault_Handler

Is it possible that I have not configured the Boot power settings properly, as I have been following the S32K344 Sample code for configuration? Thanks!

1.HarrySu_1-1687911965836.png

2.HarrySu_3-1687912811744.png

3.HarrySu_2-1687912005451.png

Best Regards,

Harry

 

4,005 次查看
anakha
Contributor III

Hi Harry,

Could you solve this issue?

Can you describe how?

0 项奖励
回复