cancel
Showing results for 
Search instead for 
Did you mean: 

Secondary bootloader

Mateusz Grosik
Associate II
Posted on March 03, 2017 at 23:31

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 = 8

flash_memory : ORIGIN = ., LENGTH = 384K-8

flash_rsvd2 : ORIGIN = ., LENGTH = 0

// 24KB of internal SRAM starting at 0x40000000

dram_rsvd1 : ORIGIN = 0x40000000, LENGTH = 0

dram_reset : ORIGIN = ., LENGTH = 0

dram_memory : ORIGIN = ., LENGTH = 24K-256

heap_reserve:origin = ., LENGTH = 8K

stack_reserve:origin = ., LENGTH = 8K

dram_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

This discussion has been locked for participation. If you have a question, please start a new topic in order to ask your question
11 REPLIES 11
Mateusz Grosik
Associate II
Posted on March 30, 2017 at 17:05

Hello

Very thanks for your help and your time.

I program my SPC5 using this applications. But I have a question about main board (with stm32 which will send a code to SPC). I have a board STM32F103 and i add transceiver TJA1040. I made a program in C#, this program can send a *.bin file to STM32 board. I made a program for STM32 how should send something using CAN. I test in only in two STM32f103 boards with transceivers. And in my Engineering Thesis i should make a something like secondary bootloader. When i program my SPC5 (using your app) i can receive program and send it to BAM?

In attachment i add my application for PC and STM32 (Google drive) maybe you can show it and you will under stand what i mean, becouse I was a little lost in this.

Its like PC->STM32F103->transceivers->SPC5 board and BAM program.

Sorry for my annoying asking but its hard for me and i cant understand that.

https://community.st.com/external-link.jspa?url=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F0B16SidgttMozS2JwT1p1bXEzMXc%2Fview%3Fusp%3Dsharing

https://drive.google.com/file/d/0B16SidgttMozVUY1clVmOThxbk0/view?usp=sharing

Best regard

Mateusz

Posted on August 04, 2017 at 05:53

Hi Procolo,

I tested the Pictus bootloader demo you attached,

with the first P50L5 board run the application ?SPC560Pxx_RLA CANsend Test Application for Discovery?,

and the second P50L5 board run the application ?SPC560Pxx_SW_BAM?,

and I faced a problem during testing:

when the UDESTK debugger is connected to P50L5 on the second board which run the application of software BAM, both boards can work normally,

the P50L5 on the second board can jump to SRAM and execute the binary code downloaded through CAN Bus successively.

but when the UDESTK debugger is disconnected from P50L5 on the second board, the downloaded binary code can not be executed as desired,

and at the same time, the message received from UART0 of the first board indicates that

P50L5 on the second board has received the binary code of new application successfully through CAN Bus.

0690X00000607r6QAA.png

I can not find the cause of this problem, have you faced the same issue during debugging of the the attached Bootloader demo?

version of software: UDE STK 4.8.2

                               SPC5Studio 5.5.0

debug tools: PLS USB/JTAG Adapter for SPC5xxx

Thanks and best regards

Marvin