SAM7DFU: Add a new 'flash_dfu' memory type
this will build *-flash_dfu.{bin,elf} targets which are targetted not for the 'raw' SAM7 hardware, but for the sam7dfu boot loader already running in it.
This commit is contained in:
parent
cb24139232
commit
7dd5963915
|
@ -28,4 +28,4 @@
|
||||||
|
|
||||||
# Defines which are the available memory targets for the AT91SAM7S-EK board.
|
# Defines which are the available memory targets for the AT91SAM7S-EK board.
|
||||||
|
|
||||||
MEMORIES = flash sram
|
MEMORIES = flash_dfu flash sram
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
/* Exception vectors
|
/* Exception vectors
|
||||||
*******************/
|
*******************/
|
||||||
.section .vectors, "a"
|
.section .vectors, "a"
|
||||||
|
#ifndef flash_dfu
|
||||||
resetVector:
|
resetVector:
|
||||||
ldr pc, =resetHandler /* Reset */
|
ldr pc, =resetHandler /* Reset */
|
||||||
undefVector:
|
undefVector:
|
||||||
|
@ -114,7 +114,7 @@ irqHandler:
|
||||||
ldmia sp!, {r0, lr}
|
ldmia sp!, {r0, lr}
|
||||||
msr SPSR_cxsf, lr
|
msr SPSR_cxsf, lr
|
||||||
ldmia sp!, {pc}^
|
ldmia sp!, {pc}^
|
||||||
|
#endif /* flash_dfu */
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
/// Initializes the chip and branches to the main() function.
|
/// Initializes the chip and branches to the main() function.
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
|
@ -124,6 +124,7 @@ irqHandler:
|
||||||
entry:
|
entry:
|
||||||
resetHandler:
|
resetHandler:
|
||||||
|
|
||||||
|
#ifndef flash_dfu
|
||||||
/* Dummy access to the .vectors section so it does not get optimized */
|
/* Dummy access to the .vectors section so it does not get optimized */
|
||||||
ldr r0, =resetVector
|
ldr r0, =resetVector
|
||||||
|
|
||||||
|
@ -137,7 +138,7 @@ resetHandler:
|
||||||
ldr r0, =LowLevelInit
|
ldr r0, =LowLevelInit
|
||||||
mov lr, pc
|
mov lr, pc
|
||||||
bx r0
|
bx r0
|
||||||
|
#endif /* flash_dfu */
|
||||||
/* Initialize the relocate segment */
|
/* Initialize the relocate segment */
|
||||||
|
|
||||||
ldr r0, =_efixed
|
ldr r0, =_efixed
|
||||||
|
@ -158,6 +159,7 @@ resetHandler:
|
||||||
strcc r2, [r0], #4
|
strcc r2, [r0], #4
|
||||||
bcc 1b
|
bcc 1b
|
||||||
|
|
||||||
|
#ifndef flash_dfu
|
||||||
/* Setup stacks
|
/* Setup stacks
|
||||||
**************/
|
**************/
|
||||||
/* IRQ mode */
|
/* IRQ mode */
|
||||||
|
@ -168,7 +170,7 @@ resetHandler:
|
||||||
/* Supervisor mode (interrupts enabled) */
|
/* Supervisor mode (interrupts enabled) */
|
||||||
msr CPSR_c, #ARM_MODE_SVC | F_BIT
|
msr CPSR_c, #ARM_MODE_SVC | F_BIT
|
||||||
mov sp, r4
|
mov sp, r4
|
||||||
|
#endif /* flash_dfu */
|
||||||
/* Branch to main()
|
/* Branch to main()
|
||||||
******************/
|
******************/
|
||||||
ldr r0, =main
|
ldr r0, =main
|
||||||
|
|
Loading…
Reference in New Issue