how to Response Pending when flash is busy writing operate?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
CY_cindy_
Level 1
Level 1
First reply posted First question asked Welcome!

Hello,

I have a product need to achieve LIN UDS bootloader,mcu is CY8C4146-S433.

 

I found that when MCU is busy with CySysFlashWriteRow() after receiving an earse memory cmd, mcu will cost aroud 4 mins to finish earsing the whole  flash memory of the bootable area;

 

according to ISO 14229-2 ,if mcu is busy with the previous cmd, it should response an NRC with 0x78,

 

but during the 4 mins described above, now MCU can't response anything.

 

I  have found there is a "Response Pending"  part in LIN_V5_0.pdf,but I don't know how to use it, or this will be helpful  to my case?

CY_cindy__0-1629273370092.png

 

 
what should I do ?
 
I'm looking forward to here  your reply.
 
 
0 Likes
3 Replies
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi @CY_cindy_ ,

Note that the LIN in PSoC4 is implemented on a software stack using UART (SCB) block. So, processing it needs CPU involvement, and if CPU is busy in CySysFlashWriteRow() , then unless this operation is completed - it won't process lin related code/isr .
 
As far as "response pending" command is concerned, it's clearly mentioned in lin datasheet on how to use it
you need to use ld_put_raw() or ld_send_message() TL API
 
Regards
Alakananda
0 Likes

Hello,Alakananda

Without calling CySysFlashWriteRow(),I have tried to response to another 0x3d frame header ,after MCU responses a NRC 0x78(response pending), but I dont't know how I can get the case of new 0x3d is received, and response new databytes.

 

my code is:

    if(ld_rx_status(LIN_1_IFC_HANDLE== LD_COMPLETED)
    {
        ld_receive_message(LIN_1_IFC_HANDLE,&LIN_DiagLength,&LIN_DiagNAD,reqMsgBuffer.data);
       //according to the receving data,than calling ld_send_message()
   }

 

the if condition can't be triggered after 15 03 22 78 is already sent;

CY_cindy__0-1629418728447.png

 

can you tell me how to edit the code,that mcu can response to the next 0x3D header after the previous NRC 0X78 is sent??

Thankyou very much

0 Likes
Alakananda_BG
Moderator
Moderator
Moderator
50 likes received 250 sign-ins 250 replies posted

Hi,

Can you send the  PSoC Project file (or LIN LDF file)? And which option is selected in API format (as shown in screenshot? And did you check the "enable transport layer"?

Alakananda_BG_0-1629958591723.png

Regards

Alakananda
0 Likes