LPC11C24 Can Bootloader Assistance

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

LPC11C24 Can Bootloader Assistance

2,021 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by jwall@hra.com on Mon Sep 12 14:57:14 MST 2011
Send me the codes!!!!,

Kidding

A few questions about forming the canopen sequence

to write to RAM spot 0x1000,0800

I would send

[67d]  [0x23 0x15  0x50 0x00 0x00 0x08 0x00 0x10]
then the data
[67d]  [0x40 0x50  0x1f 0x01 d3 d2 d1 d0]

is this well formed?
Do I need to perform the unlock command before?
0 Kudos
Reply
6 Replies

1,504 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Nov 19 16:02:33 MST 2015

Quote: mc8ain
The LPC11C14 stops giving me responses to my write commands (or my PEAK gets somehow stuck, but it's always at the same address). So in the end, I changed my code now to write only 1K at time to RAM, then I copy it to FLASH and I start over with the next 1k...



Without Log I don't know what you are doing (wrong) in detail...

Anyway, writing a complete sector is here working since years with:

#define LPC11_RAM_ADDRESS0x10000600)
0 Kudos
Reply

1,504 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by MikeSimmonds on Thu Nov 19 15:42:05 MST 2015
The obvious thing to check is the ram buffer size(s), what is needed by the boot loader.
Is there, in fact, 4KB free where you are sending the block.

It would seem not and the NXP part is getting an address or hard fault (perhaps) and
herefor cannot reply to your controlling CAN node.

If it only has a 4KB block [See UM; I don't know the specifics] the fail address is
probably trying to overwrite the stack?

Mike.
0 Kudos
Reply

1,504 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc8ain on Thu Nov 19 15:30:50 MST 2015
The LPC11C14 stops giving me responses to my write commands (or my PEAK gets somehow stuck, but it's always at the same address). So in the end, I changed my code now to write only 1K at time to RAM, then I copy it to FLASH and I start over with the next 1k... ;-)
0 Kudos
Reply

1,504 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by R2D2 on Thu Nov 19 09:19:59 MST 2015

Quote: mc8ain
So with the segmented download it should be possible to write as many bytes as I want into RAM?



Yes  :)


Quote: mc8ain
Or just the listed 3 messages?

  :D


Quote: mc8ain
So is there somewhere a limitation? I would like to write a full sector (4k) into RAM and to write it later into the FLASH.



There's no limitation, that's the usual procedure...


Quote: mc8ain
... but it get stuck at 0x1000 0F4B...



No idea what you mean with 'get stuck'  :~

Could be useful to post a CAN-Log...



0 Kudos
Reply

1,504 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by mc8ain on Thu Nov 19 07:02:58 MST 2015
So with the segmented download it should be possible to write as many bytes as I want into RAM? Or just the listed 3 messages? I am trying to write 4k into the RAM (on a LPC11C24) with starting address 0x1000 0400, but it get stuck at 0x1000 0F4B where I do not get a CAN response anymore. When reading back the RAM I am able to see that the writes to RAM were successful up to 0x1000 0F1B.

So is there somewhere a limitation? I would like to write a full sector (4k) into RAM and to write it later into the FLASH.

I intended to use 0x1000 0400 up to 0x1000 1400 for the download process, to not interfere with "26.4.8 RAM used by ISP command handler (for LPC11Cxx parts)".

Thanks for help.
0 Kudos
Reply

1,504 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Sep 15 11:24:30 MST 2011
#1 Your format is correct, if you send this messages with 100kbit/s, little indian :) (=Intel) format your should receive an answer (if the addressed bootloader is working).

#2 You need Unlock {0x2B,0x5000,0x00,0x5A,0x5A,0x00,0x00} before you use Flash Write, Erase or Go commands (See UM).

#3 [67d] [0x23 0x15 0x50 0x00 0x00 0x08 0x00 0x10] is setting your RAM write address to 0x10000800

#4 [67d] [0x40 0x50 0x1f 0x01 d3 d2 d1 d0] is a reading command. I prefer to use segmented download (See CiA Draft Standard 301 :confused:):[INDENT]{0x21,0x1F50,0x01,0x00,0x00,0x00,0x00} is initiating SDO Download and
   
{0x00, 7 data bytes} is writing (first) 7 data bytes
   
{0x10, 7 data bytes} is writing (next) 7 data bytes   

{0x00, 7 data bytes} is writing (next) 7 data bytes    ...
[/INDENT]So with toggling bit 4 of command byte you can transmit 7 bytes per message :eek:
    Setting bit 0 of command byte indicates the last message (last command = 0x00 or 0x11).

#5  To check if CAN and CAN bootloader is working, a simple  part ID request is useful:[INDENT]{0x40,0x1018,0x02,0x00,0x00,0x00,0x00}

  This request should be  answered with the correct PART ID (here: LPC11C14)

825938 -> 67D-08:40 18 10 02 00 00 00 00
825940 <- 5FD-08:43 18 10 02 2B 10 40 14[/INDENT]
0 Kudos
Reply