2017-03-03 02:31 PM
Hello
I try make a secondary bootloader. I must send my code program from stm32f103 board to SPC560P board via CAN, and program should downlaod by BAM to flash.
I used transceivers. I know i should make user.ld, but can you explain me how?
I make some standalone_ram.ld in ghs, here is my file, it is correct to ran uC in BAM mode?
MEMORY {
// 384k Internal Flash
flash_rsvd1 : ORIGIN = 0x00000000, LENGTH = 8flash_memory : ORIGIN = ., LENGTH = 384K-8flash_rsvd2 : ORIGIN = ., LENGTH = 0// 24KB of internal SRAM starting at 0x40000000dram_rsvd1 : ORIGIN = 0x40000000, LENGTH = 0dram_reset : ORIGIN = ., LENGTH = 0dram_memory : ORIGIN = ., LENGTH = 24K-256heap_reserve:origin = ., LENGTH = 8Kstack_reserve:origin = ., LENGTH = 8Kdram_rsvd2 : ORIGIN = ., LENGTH = 16}
DEFAULTS {stack_reserve = 4K
heap_reserve = 4K}
//// Program layout for running out of RAM.////SECTIONS
{.PPC.EMB.sdata0 ABS : > dram_memory.PPC.EMB.sbss0 CLEAR ABS : > ..text : > dram_memory
.vletext : > ..syscall : > ..rchw NOCHECKSUM : > ..secinfo : > ..rodata : > ..sdata2 : > ..fixaddr : > ..fixtype : > ..sdabase ALIGN(16) : > dram_memory
.sdata : > ..sbss : > ..data : > ..bss : > ..heap ALIGN(16) PAD(heap_reserve) : > . .stack ALIGN(16) PAD(stack_reserve) : > .//
// These special symbols mark the bounds of RAM and ROM memory.// They are used by the MULTI debugger.//__ghs_ramstart = MEMADDR(dram_rsvd1);__ghs_ramend = MEMENDADDR(dram_memory);__ghs_romstart = MEMADDR(flash_rsvd1);__ghs_romend = MEMENDADDR(flash_rsvd2);_ram_image_heap = ENDADDR (heap_reserve);_ram_image_stack = ENDADDR (stack_reserve);_ram_image_end = ENDADDR (.bss);}
Best regards
Mateusz
2017-03-20 07:10 AM
Hello,
I'm working on a test application allowing to get code from can and program it to flash. I will come back asap.
My Idea is to run a boot-loader which will receive code via CAN , flash code to a given address and set the boot to another flash address so at next boot , board will run this code. Does this match your requirements?
question:
is the following request related to the same problem ?:
2017-03-22 06:27 AM
Yes, sounds good. I should sending a binary code from STM32F103 to SPC560 using CAN. And SPC560 using BAM have to program a flash. SPC560 board have a transceiver and it received binary image. I will be grateful for your help.
Best regards.
Mateusz Raczkowski
2017-03-22 07:28 AM
And now i trying do it on SPC560P disp board
2017-03-24 08:35 AM
Hi,
Attached application for Discovery Pictus is a SW BAM.
it receives data from CAN bus (speed 300khz) , load to RAM and the jump
this app is tested using spc5connect with spc5 flasher.
You can start fromhere, implementing the same protocol on your STM32 and the modify the BAM to write in flash instead of RAM (if needed) using the flash component.
Please be sure to use the latest version of spc5Studio (5.2.3)
Regards,
Procolo
________________ Attachments : SPC560Pxx_SW_BAM.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyks&d=%2Fa%2F0X0000000bC1%2FvRQdu3AEIuMqLPs.4oltDPa7Zc4u5nVPqcdFWL1UZ44&asPdf=false2017-03-24 11:52 AM
Thanks a lot, i have one more question. When i useing CAN bus, i need to set a password?
Something like this in chapter 5.2:
In here i see password: 0xFEED_FACE_CAFE_BEEF
I can change this using external app?
Regard
Mateusz
2017-03-27 01:57 AM
Yes of course,
you can implement your own StartPasswordCheck(uint64_t *passwordptr ) function.
This code implements BAM via SW but you can modify it as per you needs.
Regards,
Procolo
2017-03-27 02:38 AM
Thanks, and when i use BAM and CAN i should set jumper like this: ABS0=0, ABS2=1, FAB=1?
And when i program spc560 i should receives via CAN using pins CANH and CANL. Do i think right?
Regards and thanks for your time
Mateusz
2017-03-28 01:18 AM
ABS0=01 ABS2=0, FAB=1
Regard,
Procolo
2017-03-29 04:41 AM
Hi,
Let me attach two applications.
1) it' s the BAM emulated via SW (i've solved some bugs) . it's also able to receive program from SPCCONNECT, load in ram and jump to the application
2) its a loader . It's able to send a bin file to the first application using CAN bus. the file to load (in this example is the serial test app for pictus complied with LOAD in RAM option ) is created using a free tool calledbin2header. it generate a file out_bin.h which should be put in source folder of the project.
I think this is a good starting point for your bootloader application.
Procolo
________________ Attachments : Bootloader.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hyck&d=%2Fa%2F0X0000000bBo%2FubPzeAGOaOZ_YhalXCJmDDyAXOmoGMkAdFYJDrRr7CQ&asPdf=false