Skip to content

Commit 2eee11c

Browse files
author
mean
committed
2 parents 70e8238 + 312f87e commit 2eee11c

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

Platform/Core/Targets/ArduinoFirmwareTargetCreatorStm32.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,11 @@ function(create_arduino_firmware_target TARGET_NAME BOARD_ID ALL_SRCS ALL_LIBS
136136
${TARGET_NAME}.bin
137137
COMMENT "Generating BIN image"
138138
VERBATIM)
139+
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
140+
COMMAND bash ${CMAKE_SOURCE_DIR}/cmake/freeFrash.bash
141+
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
142+
COMMENT "Computing free flash "
143+
VERBATIM)
139144
#_get_board_property(${BOARD_ID} build.mcu MCU)
140145
# Display target size
141146
#add_custom_command(TARGET ${TARGET_NAME} POST_BUILD

freeFrash.bash

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
export EEPROM=` grep "\.eeprom" *.map | sed 's/.eeprom *//g' | sed 's/ [ \t]*0x.*$//g' `
2+
export TAIL=` grep 0x0000000008 *.map | sed 's/^.*0x0000000008/0x0000000008/g' | sed 's/ .*//g' | sort | grep -v ${EEPROM} | tail -1`
3+
export FREE=$(($EEPROM-$TAIL))
4+
echo "Tail : [$TAIL] EEPROM [$EEPROM] FREE ${FREE}"
5+
printf "Free Flash = %d kB\n" $(($FREE/1024))

utils/unpatch.bash

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,7 @@ rm -Rf STM32F1/patched*
33
git checkout STM32F1/boards.txt STM32F1/system/libmaple/stm32f1/include/series/stm32.h
44
git checkout STM32F1/variants/generic_stm32f103c/board.cpp
55
git checkout STM32F1/cores/maple/main.cpp
6+
git checkout STM32F1/cores/maple/libmaple/i2c.c
7+
git checkout STM32F1/cores/maple/libmaple/i2c_f1.c
8+
git checkout STM32F1/libraries/SPI/src/SPI.cpp
9+
git checkout STM32F1/libraries/SPI/src/SPI.h

0 commit comments

Comments
 (0)