Skip to content

Commit d57feea

Browse files
authored
🐛 Fix JG Aurora A1 implementation (#27622)
1 parent 36623a2 commit d57feea

File tree

3 files changed

+107
-1
lines changed

3 files changed

+107
-1
lines changed

Marlin/src/pins/stm32f1/pins_JGAURORA_A5S_A1.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
// Enable EEPROM Emulation for this board, so that we don't overwrite factory data
5050
#if NO_EEPROM_SELECTED
5151
//#define I2C_EEPROM // AT24C64
52-
//#define FLASH_EEPROM_EMULATION
52+
#define FLASH_EEPROM_EMULATION
5353
#endif
5454

5555
#if ENABLED(I2C_EEPROM)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
/**
2+
*************** (C) COPYRIGHT 2017 STMicroelectronics ************************
3+
* @file startup_stm32f101xe.s
4+
* @author MCD Application Team
5+
* @brief STM32F101xE Value Line Devices vector table for Atollic toolchain.
6+
* This module performs:
7+
* - Set the initial SP
8+
* - Set the initial PC == Reset_Handler,
9+
* - Set the vector table entries with the exceptions ISR address
10+
* - Configure the clock system
11+
* - Branches to main in the C library (which eventually
12+
* calls main()).
13+
* After Reset the Cortex-M3 processor is in Thread mode,
14+
* priority is Privileged, and the Stack is set to Main.
15+
******************************************************************************
16+
* @attention
17+
*
18+
* <h2><center>&copy; Copyright (c) 2017 STMicroelectronics.
19+
* All rights reserved.</center></h2>
20+
*
21+
* This software component is licensed by ST under BSD 3-Clause license,
22+
* the "License"; You may not use this file except in compliance with the
23+
* License. You may obtain a copy of the License at:
24+
* opensource.org/licenses/BSD-3-Clause
25+
*
26+
******************************************************************************
27+
*/
28+
29+
.syntax unified
30+
.cpu cortex-m3
31+
.fpu softvfp
32+
.thumb
33+
34+
.global g_pfnVectors
35+
.global Default_Handler
36+
37+
/* start address for the initialization values of the .data section.
38+
defined in linker script */
39+
.word _sidata
40+
/* start address for the .data section. defined in linker script */
41+
.word _sdata
42+
/* end address for the .data section. defined in linker script */
43+
.word _edata
44+
/* start address for the .bss section. defined in linker script */
45+
.word _sbss
46+
/* end address for the .bss section. defined in linker script */
47+
.word _ebss
48+
49+
.equ BootRAM, 0xF1E0F85F
50+
/**
51+
* @brief This is the code that gets called when the processor first
52+
* starts execution following a reset event. Only the absolutely
53+
* necessary set is performed, after which the application
54+
* supplied main() routine is called.
55+
* @param None
56+
* @retval : None
57+
*/
58+
59+
.section .text.Reset_Handler
60+
.weak Reset_Handler
61+
.type Reset_Handler, %function
62+
Reset_Handler:
63+
64+
/* Disable SysTick interrupt (was enabled by jg aurora bootloader) */
65+
ldr r2,SysTick
66+
movs r1, #0
67+
str r1, [r2]
68+
/* Copy the data segment initializers from flash to SRAM */
69+
b LoopCopyDataInit
70+
SysTick:
71+
.word 0xE000E010
72+
CopyDataInit:
73+
ldr r3, =_sidata
74+
ldr r3, [r3, r1]
75+
str r3, [r0, r1]
76+
adds r1, r1, #4
77+
78+
LoopCopyDataInit:
79+
ldr r0, =_sdata
80+
ldr r3, =_edata
81+
adds r2, r0, r1
82+
cmp r2, r3
83+
bcc CopyDataInit
84+
ldr r2, =_sbss
85+
b LoopFillZerobss
86+
/* Zero fill the bss segment. */
87+
FillZerobss:
88+
movs r3, #0
89+
str r3, [r2], #4
90+
91+
LoopFillZerobss:
92+
ldr r3, = _ebss
93+
cmp r2, r3
94+
bcc FillZerobss
95+
96+
/* Call the clock system intitialization function.*/
97+
bl SystemInit
98+
/* Call static constructors */
99+
bl __libc_init_array
100+
/* Call the application's entry point.*/
101+
bl main
102+
bx lr
103+
104+
.size Reset_Handler, .-Reset_Handler

ini/stm32f1.ini

+2
Original file line numberDiff line numberDiff line change
@@ -364,6 +364,8 @@ board_build.offset = 0xA000
364364
board_upload.offset_address = 0x0800A000
365365
build_flags = ${stm32_variant.build_flags}
366366
-DSTM32F1xx -DSTM32_XL_DENSITY
367+
build_unflags = ${stm32_variant.build_unflags}
368+
-DUSBCON -DUSBD_USE_CDC
367369
extra_scripts = ${stm32_variant.extra_scripts}
368370
buildroot/share/PlatformIO/scripts/jgaurora_a5s_a1_with_bootloader.py
369371

0 commit comments

Comments
 (0)