From 905ed60d44d1ffe9b4955d43255938b36121a031 Mon Sep 17 00:00:00 2001 From: timschuerewegen <4085193+timschuerewegen@users.noreply.github.com> Date: Fri, 16 Apr 2021 22:46:08 -0600 Subject: [PATCH] Import Tim's version --- payload/payload.S | 60 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 45 insertions(+), 15 deletions(-) diff --git a/payload/payload.S b/payload/payload.S index 7385aa3..59f69a0 100644 --- a/payload/payload.S +++ b/payload/payload.S @@ -1,3 +1,5 @@ +.syntax unified + .section .text .global _start @@ -44,23 +46,51 @@ foo: nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop; +// __disable_interrupt(); +CPSID I +// LTDC_Layer1->CR = 0; // disable layer +// LTDC_Layer1->DCCR = 0xFF0000FF; // blue +LDR R0, =0x50001084 +MOVS R1, #0 +STR R1, [R0, #0x00] +LDR R1, =0xFF0000FF +STR R1, [R0, #0x18] -mov r2, #0 -mov r4, #4 -loop: - ldr r0, src - ldr r1, dst +// LTDC_Layer2->CR = 0; // disable layer +LDR R0, =0x50001104 +MOVS R1, #0 +STR R1, [R0, #0x00] - add r0, r0, r2 - add r1, r1, r2 +// LTDC->SRCR = 1; // reload shadow registers now +// LTDC->BCCR = 0x000000; // black +LDR R0, =0x50001000 +MOVS R1, #1 +STR R1, [R0, #0x24] +MOVS R1, #0 +STR R1, [R0, #0x2C] - ldr r3, [r0] - str r3, [r1] +// uint32_t *src = (uint32_t*)0x08000000; +// uint32_t *dst = (uint32_t*)0x24000000; +// for (int len = 0; len < 0x20000 / 4; len++) +// { +// *dst++ = *src++; +// } +MOV R0, #0x08000000 +MOV R1, #0x24000000 +MOV R2, #0x8000 +loop1: +LDR R3, [R0], #4 +STR R3, [R1], #4 +SUBS R2, R2, #1 +BNE loop1 - add r2, r2, r4 - - b loop - -src: .long 0x08000000 -dst: .long 0x24000000 +// while (1) +// { +// WWDG1->CR = 0x69; +// } +LDR R0, =0x50003000 +MOVS R1, #0x69 +loop2: +STR R1, [R0, #0x00] +B loop2