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!
Solved! Go to Solution.
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
Hi,
I am using the project "S32K344_Can_bootloader_RTD200" in the microprocessor S32K344. I want to download an application with the program of bootloader. I have achieved the jump from program to application but I have different questions.
1. I want to use #define EN_DELAY_TIME but when I uncomment the command in the folder "public_inc", the program has different errors. My target to use "Backdoor", that is to say, I want to check if the program has to enter to bootloader or not. I don´t know the process and the different functions that I have to use to achieve the target. I want to use the function "Boot_CheckReqBootloaderMode(void)" but when I debug the program, it never enters to the "if". Could you explain me the process and the steps to achieve the target. I add different functions that I think are important.
2. I don´t know if I have to modificate the parameters of "static tJumpAppDelayTimeInfo gs_stJumpAPPDelayTimeInfo = {FALSE, 0u};". I have to change this structure ? You can see all structure in one of the next pictures.
I need the reply as soon as possible since I have to send a project very soon.
Thank you for all,
Jon Ander Amante Jorge
Hi, @JonAnder_Amante
The DELAY_MAX_TIME_MS is used to, enter bootloader mode and have not received any UDS commands, if waiting DELAY_MAX_TIME_MS timeout, then jump to APP if APP is valid. You un-need to modify the global variable or content.
BR
Tomlin
Hi,
I have a problem when I try to use "#define EN_DELAY_TIME", if I uncomment this command I have different errors and I don´t know how solve the problem. I don´t the reason of error, could you give solve my question as soon as possible because I have to send the project very soon.
Thank you for all,
Jon Ander Amante
Hi, @JonAnder_Amante
I checked the code. The error maybe we have not used feature in new bootloader version. So, always disable the macro. If you want to enable the feature, suggestion:
1. Create a new function in uds_app_cfg.c
void UDS_Cfg_Init(void)
{
#ifdef EN_DELAY_TIME
gs_stJumpAPPDelayTimeInfo.jumpToAPPDelayTime = UdsAppTimeToCount(DELAY_MAX_TIME_MS);
#endif
}
2. UDS_Init
-Remove the code
#ifdef EN_DELAY_TIME
gs_stJumpAPPDelayTimeInfo.jumpToAPPDelayTime = UdsAppTimeToCount(DELAY_MAX_TIME_MS);
#endif
- Call UDS_Cfg_Init(); in UDS_Init
Hope this can help you!
BR
Tomlin
Hi,
At now I dont´t receive the error of implementation but I have different questions about this. I don´t know how I can send the request to enter to bootloader. I have looked and I have seen that in my program the function "if(gs_stBootInfo.requestEnterBootloader == *((uint8*)gs_stBootInfo.requestEnterBootloaderAddr))" never is True so I think that I have a problem in this function. I also send you the value of these parameters. Maybe the configuration is done from "ECUBUS" application but I don´t know how send the request of bootloader (I have also sent you the picture of the ECUBUS because perhaps I have to do some configuration in ECUBUS).
I need your reply as soon as possible because I have to send the project very soon.
Thank you for all,
Hello,
ECU-BUS send the UDS command (0x10 0x02) will trigger the APP reset and enter bootloader. If only have bootloader in MCU, then the bootloader will not reset.
BR
Tomlin
Hi,
1. I don´t understand what you have explained me so could you tell me the steps to achieve that this function to be True "if(gs_stBootInfo.requestEnterBootloader == *((uint8*)gs_stBootInfo.requestEnterBootloaderAddr))".
2. Moreover, coould you tell me how I can send the request of bootloader because I don´t know how to do it.
3. Finally, could you tell me the purpose to send the service "WriteDataByIdentifer". I send you different pictures again.
Thank you for all,
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
Hello nxf10035,
Many thanks for your advice and guidance. It has given me a good direction.
Since I am still a beginner in the field of Bootloaders, I would like to confirm something with you.
Q1. The difference between the sample codes 'project _S32K344_APP_Demo_RTD2d0' and 'project _S32K344_CAN_Bootloader_RTD2d0,' is that the APP code serves as the object to be programmed via CAN, while the Bootloader code is the main code for the MCU, which needs to be programmed using the regular programming method. Am I understanding this correctly?"
Q2. In my own Application code do I need to include the 'APP_bootloader_exchange_info' file from the sample code's App src directory? This allows the MCU to update the firmware via CAN while it is running?
Best Regards,
Harry
Hi, Harry,
Answer as following:
Q1. The difference between the sample codes 'project _S32K344_APP_Demo_RTD2d0' and 'project _S32K344_CAN_Bootloader_RTD2d0,' is that the APP code serves as the object to be programmed via CAN, while the Bootloader code is the main code for the MCU, which needs to be programmed using the regular programming method. Am I understanding this correctly?"
Tomlin: Yes, most of time the APP programed by bootloader.
Q2. In my own Application code do I need to include the 'APP_bootloader_exchange_info' file from the sample code's App src directory? This allows the MCU to update the firmware via CAN while it is running?
Tomlin: No, the APP_bootloader_exchange_info is used to exchange information between APP with bootloader when needed to update APP. APP should integrate UDS stack. Suggestion you can reference OEM spec.
BR
Tomlin
Hello Tomlin @nxf10035 ,
Thanks for previous advice, I have already build successfully on S32K342 MCU using S32K344 CAN bootloader sample code, FW could be programmed into MCU too.
But I encounter another problem now. I have connected PEAK CAN donggle to GUI ECUBus.
I import the ECUBUS_344CAN_uds.json to PCAN UDS schedule from sample file: S32K3xx\S32K344_CAN\
When I click "start" on GUI, there is an error below show : Write from 0xb to 0x16 with RA 0x0,result:undefined
How can i solve this problem? Thanks!
Best Regards,
Harry
Hello Tom @nxf10035 ,
Thanks for your reply, my CAN config setting is below, I followed the PDF:ECU-Bus User Guide page4 setting.
About config setting on S32K342, I have an one different setting from S32K344 CAN boot loader.
In below picture, Number Of MB :14, 14 is the maximum value that I can set in S32K342.
But S32K344 set Number Of MB :16, will it cause any error on CAN communication?
Best Regards,
Harry
Hi, @HarrySu
We just test on PCAN-USB Pro. What's your hardware type? I think you can send UDS message(0x02 0x10 0x03) to verify the hardware and bootloader working normally or not in GUI.
BR
Tomlin
Hello Tom @nxf10035 ,
This is my PEAK CAN Pro HW type:
About the UDS Message,
Did you mean use PCAN view directly transmit id:0x784 payload:0x02 0x10 0x03? ( PCAN setting show below)
MCU didn't response anything.
BR
Harry
Hi, @HarrySu
Looks like the hardware is the same. Yes, PCAN view send the UDS message. If you choose CANFD, please select nominal bit rate and data bit rate are 500K.
BR
Tomlin
Hello Tom @nxf10035 ,
What is the number of CAN ID?, could you please show the PCAN view message window?
I also want to know what the message will MCU bootloader response, Thanks a lot!
Best Regards,
Harry
Hi, @HarrySu
The PCAN View send: ID(0x784) data: 0x02 0x10 0x03. Bootloader response: ID(0x7F0) data: 0x02 0x50 0x03 Please note, the IDs are default IDs, if you are modified. Theses CAN IDs will be changed.
BR
Tomlin
Hello Tom @nxf10035 ,
I think the problem may be that I didn't include cpu.h and port.h in the includes.h previously,
but now that I have added them, it says that cpu.h and port.h cannot be found. How can I resolve this issue? Thanks!
Best Regards,
Harry
Hi, @HarrySu
The CPU.h and port.h is used other platform. For S32K342, you should follow S32K3x2 bootloader configuration and linkfile. S32K3x4 and S32K3x2 have some different.
BR
Tomlin