C_CAN ISP Write-to-RAM Failure

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

C_CAN ISP Write-to-RAM Failure

758 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alt_arw on Fri Sep 11 11:35:11 MST 2015
We have a design that uses the LPC1517 and we'd like to be able to use the C_CAN ISP for firmware upgrades.  I've been experimenting with the SDO communication and cannot get the "Write to RAM" function to work.  It's always giving me the SDO abort code 0x0601000, which is "Unsupported access to an object".  I've verified that we can get the device into ISP mode and can get many of the SDO functions to work without abort codes.  In looking at the memory map from the user manual for 15xx, I believe that address 0x02001000 should be a RAM address for the 1517 outside the area used by the boot loader.  We thought it might be related to the CRP, but we verified that the CRP register (0x2FC) is set so CRP is not enabled.  Plus, if CRP were the issue, I would expect to receive the abort code for CODE_READ_PROTECTION_ENABLED.  Below is the sequence of CAN messages that are being sent to the device along with the response.  Any insight into what I'm doing wrong or why it's setup wrong would be appreciated.

Read Device Type
TX: 67d 40 0 10 0 0 0 0 0
RX: 5fd 43 0 10 0 4c 50 43 31
Unlock
TX: 67d 2b 0 50 0 5a 5a 0 0
RX: 5fd 60 0 50 0 0 0 0 0
Blank Check
TX: 67d 2b 40 50 1 0 1 0 0
RX: 5fd 80 40 50 1 8 0 0 f (abort code = 0xF00008 - SECTOR_NOT_BLANK)
Write Address
TX: 67d 23 15 50 0 0 10 0 2
RX: 5fd 60 15 50 0 0 0 0 0
Write Address
TX: 67d 23 50 1f 1 a5 5a a5 5a
RX: 5fd 80 50 1f 1 0 0 1 6 (abort code = 0x6010000 - Unsupported access to an object WHY???)
Set Read Address
TX: 67d 23 10 50 0 0 10 0 2
RX: 5fd 60 10 50 0 0 0 0 0
Labels (1)
0 Kudos
4 Replies

689 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alt_arw on Fri Sep 11 14:36:29 MST 2015
I found the issue and now the reading is working correctly.  As soon as I submitted the last post I went back and reviewed what it was sending.  It was sending two download initiates instead of initiate and segment.  Once that was fixed, the RAM read came back with what was written.  This is my first foray into CANopen SDO, so I'm not that familiar with the nuances of the protocol.  Thanks again for your fix with the write problem.  That had me stumped.
0 Kudos

689 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Fri Sep 11 14:35:15 MST 2015

Quote: alt_arw
My next issue is trying to read back what was written to RAM to verify my write.



Would suggest to use the debugger to check your RAM data before  :O

BTW: ZeRo explained SDO transfer in:

https://www.lpcware.com/content/forum/lpc11c24-can-bootloader-assistance
0 Kudos

689 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by alt_arw on Fri Sep 11 14:09:31 MST 2015
Thanks, R2D2, that seems to work.  My next issue is trying to read back what was written to RAM to verify my write.  I set the read address and length to the same as what I just wrote (0x2001000, 4).  I'm not getting back what I wrote and am wondering why.  The CAN sequence is below:

Write Address
TX: ID: 67d 23 15 50 0 0 10 0 2
RX: ID: 5fd 60 15 50 0 0 0 0 0
Write Init Data
TX: ID: 67d 21 50 1f 1 4 0 0 0
RX: ID: 5fd 60 50 1f 1 0 0 0 0
Write Segment Data
TX: ID: 67d 21 50 1f 1 a5 5a a5 5a
RX: ID: 5fd 60 50 1f 1 0 0 0 0
Read Write Address
TX: ID: 67d 40 15 50 0 0 0 0 0
RX: ID: 5fd 43 15 50 0 0 10 0 2
Set Read Address
TX: ID: 67d 23 10 50 0 0 10 0 2
RX: ID: 5fd 60 10 50 0 0 0 0 0
Set Read Length
TX: ID: 67d 23 11 50 0 4 0 0 0
RX: ID: 5fd 60 11 50 0 0 0 0 0
Read Init Data
TX: ID: 67d 40 50 1f 1 0 0 0 0
RX: ID: 5fd 40 50 1f 1 0 0 0 0
Read SegmentData
TX: ID: 67d 60 0 0 0 0 0 0 0
RX: ID: 5fd 7 4 ff 0 0 0 0 0
0 Kudos

689 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Fri Sep 11 12:03:16 MST 2015

Quote: alt_arw
Write Address
TX: 67d 23 50 1f 1 a5 5a a5 5a
RX: 5fd 80 50 1f 1 0 0 1 6 (abort code = 0x6010000 - Unsupported access to an object WHY???)



That's wrong  :((

Try:

TX: 67d 21 50 1f  01 00 00 00 00

and receive:

RX: 67d 60 50 1f  01 00 00 00 00

:)

0 Kudos