Skip to content

Commit 0a76520

Browse files
Jamie SmithVictor TangVictorWTang
authored
Allow memap.py to process memory bank information (#345)
* Begin modernizing memap, add parsing of start address and symbol names * Memap can now process and print memory bank info! * Rename symbols back to modules, it was correct before * Remove trailing whitespace * Add type hints to modernized functions * Apply suggestions from code review Co-authored-by: VictorWTang <[email protected]> * Remove else Co-authored-by: VictorWTang <[email protected]> * Clarify statement --------- Co-authored-by: Victor Tang <[email protected]> Co-authored-by: VictorWTang <[email protected]>
1 parent 037fe9b commit 0a76520

File tree

9 files changed

+398
-552
lines changed

9 files changed

+398
-552
lines changed

targets/TARGET_NXP/TARGET_LPC176X/device/TOOLCHAIN_GCC_ARM/startup_LPC17xx.S

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,20 +30,6 @@
3030
aborting compilation, it is not the run time limit:
3131
Heap_Size + Stack_Size = 0x80 + 0x80 = 0x100
3232
*/
33-
.section .stack
34-
.align 3
35-
#ifdef __STACK_SIZE
36-
.equ Stack_Size, __STACK_SIZE
37-
#else
38-
.equ Stack_Size, 0xc00
39-
#endif
40-
.globl __StackTop
41-
.globl __StackLimit
42-
__StackLimit:
43-
.space Stack_Size
44-
.size __StackLimit, . - __StackLimit
45-
__StackTop:
46-
.size __StackTop, . - __StackTop
4733

4834
.section .heap
4935
.align 3

tools/cmake/mbed_target_functions.cmake

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,17 @@ function(mbed_generate_map_file target)
4848
set(MBED_MEMAP_CREATE_JSON FALSE CACHE BOOL "create report in json file")
4949
set(MBED_MEMAP_CREATE_HTML FALSE CACHE BOOL "create report in html file")
5050

51+
# Config process saves the JSON file here
52+
set(MEMORY_BANKS_JSON_PATH ${CMAKE_BINARY_DIR}/memory_banks.json)
53+
5154
# generate table for screen
5255
add_custom_command(
5356
TARGET
5457
${target}
5558
POST_BUILD
5659
COMMAND ${Python3_EXECUTABLE} -m memap.memap
5760
-t ${MBED_TOOLCHAIN} ${CMAKE_CURRENT_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.map
58-
--depth ${MBED_MEMAP_DEPTH}
61+
--depth ${MBED_MEMAP_DEPTH} --memory-banks-json ${MEMORY_BANKS_JSON_PATH}
5962
WORKING_DIRECTORY
6063
${mbed-os_SOURCE_DIR}/tools/python
6164
)
@@ -71,6 +74,7 @@ function(mbed_generate_map_file target)
7174
--depth ${MBED_MEMAP_DEPTH}
7275
-e json
7376
-o ${CMAKE_CURRENT_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.memmap.json
77+
--memory-banks-json ${MEMORY_BANKS_JSON_PATH}
7478
WORKING_DIRECTORY
7579
${mbed-os_SOURCE_DIR}/tools/python
7680
)
@@ -87,6 +91,7 @@ function(mbed_generate_map_file target)
8791
--depth ${MBED_MEMAP_DEPTH}
8892
-e html
8993
-o ${CMAKE_CURRENT_BINARY_DIR}/${target}${CMAKE_EXECUTABLE_SUFFIX}.memmap.html
94+
--memory-banks-json ${MEMORY_BANKS_JSON_PATH}
9095
WORKING_DIRECTORY
9196
${mbed-os_SOURCE_DIR}/tools/python
9297
)

0 commit comments

Comments
 (0)