One step forware for STM32 target
authorandre Ebersold <andre.ebersold@free.fr>
Mon, 15 Jan 2024 21:22:07 +0000 (22:22 +0100)
committerandre Ebersold <andre.ebersold@free.fr>
Mon, 15 Jan 2024 21:22:07 +0000 (22:22 +0100)
36 files changed:
CMakeLists.txt
HAL/ST/CMakeLists.txt [new file with mode: 0644]
HAL/ST/stm32f103/MCU.cpp [new file with mode: 0644]
HAL/ST/stm32f103/MCU.h [new file with mode: 0644]
HAL/ST/stm32f103/MCUDma.cpp [new file with mode: 0644]
HAL/ST/stm32f103/MCUDma.h [new file with mode: 0644]
HAL/ST/stm32f103/MCUI2c.cpp [new file with mode: 0644]
HAL/ST/stm32f103/MCUI2c.h [new file with mode: 0644]
HAL/ST/stm32f103/MCUInterrupt.cpp [new file with mode: 0644]
HAL/ST/stm32f103/MCUInterrupt.h [new file with mode: 0644]
HAL/ST/stm32f103/MCUIo.cpp [new file with mode: 0644]
HAL/ST/stm32f103/MCUIo.h [new file with mode: 0644]
HAL/ST/stm32f103/MCUSpi.cpp [new file with mode: 0644]
HAL/ST/stm32f103/MCUSpi.h [new file with mode: 0644]
HAL/ST/stm32f103/MCUTimer.cpp [new file with mode: 0644]
HAL/ST/stm32f103/MCUTimer.h [new file with mode: 0644]
HAL/ST/stm32f103/MCUUart.cpp [new file with mode: 0644]
HAL/ST/stm32f103/MCUUart.h [new file with mode: 0644]
HAL/ST/stm32g030/MCU.cpp [new file with mode: 0644]
HAL/ST/stm32g030/MCU.h [new file with mode: 0644]
HAL/ST/stm32g030/MCUDma.cpp [new file with mode: 0644]
HAL/ST/stm32g030/MCUDma.h [new file with mode: 0644]
HAL/ST/stm32g030/MCUI2c.cpp [new file with mode: 0644]
HAL/ST/stm32g030/MCUI2c.h [new file with mode: 0644]
HAL/ST/stm32g030/MCUInterrupt.cpp [new file with mode: 0644]
HAL/ST/stm32g030/MCUInterrupt.h [new file with mode: 0644]
HAL/ST/stm32g030/MCUIo.cpp [new file with mode: 0644]
HAL/ST/stm32g030/MCUIo.h [new file with mode: 0644]
HAL/ST/stm32g030/MCUSpi.cpp [new file with mode: 0644]
HAL/ST/stm32g030/MCUSpi.h [new file with mode: 0644]
HAL/ST/stm32g030/MCUTimer.cpp [new file with mode: 0644]
HAL/ST/stm32g030/MCUTimer.h [new file with mode: 0644]
HAL/ST/stm32g030/MCUUart.cpp [new file with mode: 0644]
HAL/ST/stm32g030/MCUUart.h [new file with mode: 0644]
rules/gcc-arm-generic.cmake
rules/target-stm32g030.cmake

index 6d9f5f5748c075cbe78dfaaf1135b8157bf493eb..c533ab2847ceafa48e05e25a2ecf253157b3d742 100644 (file)
@@ -1,5 +1,8 @@
 cmake_minimum_required(VERSION 2.8)
 project(tinyapp)
+
+SET(BUILD_TARGET "stm32g030" CACHE STRING "Target [stm32g030, stm32F103, atmega328p,atmega32u4]")
+
 if("${BUILD_TARGET}" STREQUAL "atmega328p")
   include(${CMAKE_CURRENT_SOURCE_DIR}/rules/target-atmega328p.cmake)
 elseif ("${BUILD_TARGET}" STREQUAL "atmega32u4")
diff --git a/HAL/ST/CMakeLists.txt b/HAL/ST/CMakeLists.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCU.cpp b/HAL/ST/stm32f103/MCU.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCU.h b/HAL/ST/stm32f103/MCU.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUDma.cpp b/HAL/ST/stm32f103/MCUDma.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUDma.h b/HAL/ST/stm32f103/MCUDma.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUI2c.cpp b/HAL/ST/stm32f103/MCUI2c.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUI2c.h b/HAL/ST/stm32f103/MCUI2c.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUInterrupt.cpp b/HAL/ST/stm32f103/MCUInterrupt.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUInterrupt.h b/HAL/ST/stm32f103/MCUInterrupt.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUIo.cpp b/HAL/ST/stm32f103/MCUIo.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUIo.h b/HAL/ST/stm32f103/MCUIo.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUSpi.cpp b/HAL/ST/stm32f103/MCUSpi.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUSpi.h b/HAL/ST/stm32f103/MCUSpi.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUTimer.cpp b/HAL/ST/stm32f103/MCUTimer.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUTimer.h b/HAL/ST/stm32f103/MCUTimer.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUUart.cpp b/HAL/ST/stm32f103/MCUUart.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32f103/MCUUart.h b/HAL/ST/stm32f103/MCUUart.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCU.cpp b/HAL/ST/stm32g030/MCU.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCU.h b/HAL/ST/stm32g030/MCU.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUDma.cpp b/HAL/ST/stm32g030/MCUDma.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUDma.h b/HAL/ST/stm32g030/MCUDma.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUI2c.cpp b/HAL/ST/stm32g030/MCUI2c.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUI2c.h b/HAL/ST/stm32g030/MCUI2c.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUInterrupt.cpp b/HAL/ST/stm32g030/MCUInterrupt.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUInterrupt.h b/HAL/ST/stm32g030/MCUInterrupt.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUIo.cpp b/HAL/ST/stm32g030/MCUIo.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUIo.h b/HAL/ST/stm32g030/MCUIo.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUSpi.cpp b/HAL/ST/stm32g030/MCUSpi.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUSpi.h b/HAL/ST/stm32g030/MCUSpi.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUTimer.cpp b/HAL/ST/stm32g030/MCUTimer.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUTimer.h b/HAL/ST/stm32g030/MCUTimer.h
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUUart.cpp b/HAL/ST/stm32g030/MCUUart.cpp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/HAL/ST/stm32g030/MCUUart.h b/HAL/ST/stm32g030/MCUUart.h
new file mode 100644 (file)
index 0000000..e69de29
index 00e1715e137039e541e9cb5bf76e9d0e6629f2d3..45dda3d1c296459c145cd786e778256d407e92c7 100644 (file)
@@ -83,7 +83,7 @@ endif(NOT STM32_UPLOAD_CONFIG)
 #default stm32-size args
 if(NOT STM32_SIZE_ARGS)
     SET(
-           STM32_SIZE_ARGS -c;--mcu=${STM32_MCU}
+           STM32_SIZE_ARGS -c;--mcpu=${STM32_MCU}
     )
 endif(NOT STM32_SIZE_ARGS)
 
@@ -149,8 +149,8 @@ function(add_avr_executable EXECUTABLE_NAME)
    set_target_properties(
       ${elf_file}
       PROPERTIES
-      COMPILE_FLAGS "-mmcu=${STM32_MCU} -mlittle-endian -thumb -mcpu=${STM32_CORE}"
-      LINK_FLAGS "-mmcu=${STM32_MCU} -Wl,--gc-sections -mrelax -Wl,-Map,${map_file}"
+      COMPILE_FLAGS "-mmcpu=${STM32_MCU} -mlittle-endian -thumb -mcpu=${STM32_CORE}"
+      LINK_FLAGS "-mmcpu=${STM32_MCU} -Wl,--gc-sections -mrelax -Wl,-Map,${map_file}"
    )
 
    add_custom_command(
@@ -236,7 +236,7 @@ function(add_avr_library LIBRARY_NAME)
     set_target_properties(
             ${lib_file}
             PROPERTIES
-           COMPILE_FLAGS "-mmcu=${STM32_MCU} -mcpu=${STM32_CORE}"
+           COMPILE_FLAGS "-mcpu=${STM32_MCU} -mcpu=${STM32_CORE}"
             OUTPUT_NAME "${lib_file}"
     )
 
index 6da861cda1e2e6ad253b489e6d8c54fe2b9ca286..d5304261b9f3c5eb40c2634590025bc7aacd537d 100644 (file)
@@ -9,7 +9,8 @@ set(STM32_UPLOADTOOL_BAUDRATE 57600)
 ##########################################################################
 # AVR and fuses needs to be set
 ##########################################################################
-set(STM32_MCU stm32g030 CACHE STRING "STM32 MCU type stm32g030")
+set(STM32_MCU cortex-m0 CACHE STRING "STM32 MCU type stm32g030")
+set(STM32_CORE cortex-m0 CACHE STRING "STM32 MCU type stm32g030")
 set(AVR_H_FUSE 0xd9)
 set(AVR_L_FUSE 0xc3)