Commit Graph

2369 Commits

Author SHA1 Message Date
Rafael Silva 2f3c2c20a1 target/renesas: split flash preparation and termination logic to prepare/done functions 2022-08-26 13:32:06 -04:00
Rafael Silva 78296deffb target/renesas: remove alignment checks 2022-08-26 13:32:06 -04:00
Rafael Silva 3a28b58aa9 target/renesas: add enter_flash_mode function 2022-08-26 13:32:06 -04:00
Rafael Silva 31856f028f target/renesas: add rv40 flash error check 2022-08-26 13:32:06 -04:00
Rafael Silva 01cd733745 target/renesas: simplify rv40 block erase logic 2022-08-26 13:32:06 -04:00
Rafael Silva fcfbc0fdf1 target/renesas: add rv40 flash support 2022-08-26 13:32:06 -04:00
Rafael Silva a67fe703e4 target: add Renesas initial support 2022-08-26 13:32:06 -04:00
Sean Cross c8edad4ed3 sam4l: fix debug formatting
SAM4L added a DEBUG_INFO command that uses insufficiently-specific formatting.
This breaks compiles on ESP32.

Use specific formatters. Additionally, ensure that FLASHCALW_BASE is
defined as a long int, which allows it to be formatted with "%x".

Signed-off-by: Sean Cross <sean@xobs.io>
2022-08-25 23:08:45 -04:00
Mikaela Szekely 7e701add55 Apply header include guard cleanup from #1209 to gdb_reg.h 2022-08-25 18:29:57 -04:00
Mikaela Szekely 9576d13cf7 misc: rename ARRAY_SIZE to ARRAY_LENGTH and guard it 2022-08-25 18:29:57 -04:00
Mikaela Szekely 6217da4eab clang-format on cortexa.c, cortexm.c, gdb_reg.c, and gdb_reg.h 2022-08-25 18:29:57 -04:00
Mikaela Szekely bc5a41530e target/cortex: we remembered calloc() exists and saved another 16 bytes 2022-08-25 18:29:57 -04:00
Mikaela Szekely 2cf1aff698 target/cortex: malloc/free tdesc on attach/detach instead of once on probe 2022-08-25 18:29:57 -04:00
Mikaela Szekely 8f4a8ab593 target/cortex: fix -Wconversion warnings in dynamic tdesc generation 2022-08-25 18:29:57 -04:00
Mikaela Szekely d16b0f8b47 misc: move ARRAY_SIZE macro into general.h 2022-08-25 18:29:57 -04:00
Mikaela Szekely c136b919cd target/cortex: dynamically generate tdesc strings to save code size
This commit removes the previous tdesc_cortex_a, tdesc_cortex_m, and
tdesc_cortex_mf XML string literals used for target description to GDB,
now instead programmatically generating them at runtime to significantly
deduplicate the characters that get embedded into the binary.

Output of ld's --print-memory-usage during final link before:
Memory region         Used Size  Region Size  %age Used
             rom:      116388 B       128 KB     88.80%
             ram:        3348 B        20 KB     16.35%

Output of ld's --print-memory-usage during final link now:
Memory region         Used Size  Region Size  %age Used
             rom:      113032 B       128 KB     86.24%
             ram:        3376 B        20 KB     16.48%

So all in all this saves 3356 bytes of flash.

Note: the exact size saved when compiled on your machine may differ, as
the size of the build seems at least partially non-deterministic.
We've gotten slightly different sizes (within 15 bytes of each other)
at different times, with the only differences being things like which
files were rebuilt in an incremental rebuild, or the order object files
were given to the linker command line. The numbers given above were the
numbers we got when testing the final builds from scratch, but all the
sizes we got were extremely similar to the sizes listed above.
2022-08-25 18:29:57 -04:00
Rafael Silva 42145f708b target/stm32l0: macro cleanup 2022-08-25 18:10:41 -04:00
Rafael Silva 085dcb7bc9 target/stm: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva 67c9f3f6e2 target/sam: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva 44f7984c58 target/rp: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva ac6aaaeab0 target/nxpke04: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva 220293abc6 target/nrf51: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva 232b6dd376 target/msp432: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva f0c955432b target/lpc: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva 50057d3f55 target/lmi: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva b78818b9ee target/kinetis: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva a6e5b18707 target/efm32: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva cf28b352a7 target/ch32f1: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva e968fc956c target_flash: flash read write return bool 2022-08-25 18:10:41 -04:00
Rafael Silva 664d09786a workflows: add size diff workflow 2022-08-24 17:24:28 -04:00
Rafael Silva deb6198921 target_flash: swap while for forloop in buffered flush 2022-08-24 16:03:40 -04:00
Rafael Silva 1a1f4b76ff target_flash: change return types to bool 2022-08-24 16:03:40 -04:00
Rafael Silva aec7460426 target_flash: use new variable for buf size
in cases where blocksize is very large, the allocation may fail due to its size, allow specifying smaller buffer sizes
2022-08-24 16:03:40 -04:00
Rafael Silva be4b07f5ef target_flash: optimize flash prepare/done calls on erase 2022-08-24 16:03:40 -04:00
Rafael Silva 7f25846d36 target_flash: rework buffered writes
ensures aligned writes (aligned to ->writesize)
allows writes to flash smaller than buffer size
deallocate buffer only when done flashing
ensure flashing when writing intermittent blocks of data
new "prepare -> write -> done" function call flow
2022-08-24 16:03:40 -04:00
Rafael Silva 44a028344a target_flash: add prepare routine and extra return checks 2022-08-24 16:03:40 -04:00
Rafael Silva e72edc0579 target_flash: abstract target flash mode/flash preparation 2022-08-24 16:03:40 -04:00
Rafael Silva 520be57e3d target: split target flash functions into seperate file 2022-08-24 16:03:40 -04:00
Rafael Silva 3d3dd21d48 target: ensure aligned erases 2022-08-24 16:03:40 -04:00
Rafael Silva 89a5c2a8a2 target: target_addr type name cleanup 2022-08-24 16:03:40 -04:00
Rafael Silva 21922676f9 target: target_flash type cleanup 2022-08-24 16:03:40 -04:00
Piotr Esden-Tempski 31adb2f94d misc: Cleanup include guards.
Using underscore prefixes is not allowed for include guards as all
defines starting with underscore are reserved. At the same time made
file ends and spacing and style of include guards consistent in all
headers.

The new style of include guards also includes the directory of the
include file relative to `src` directory to prevent potential future
issues where we might end up with a name clash across directories.
2022-08-23 15:06:21 -04:00
Piotr Esden-Tempski 12771eeb40 Added two missing license headers in BMDA. 2022-08-23 10:20:44 -04:00
Piotr Esden-Tempski 93b31d9cf0 swo-docs: Converted to markdown and cleaned up a bit. 2022-08-23 10:19:43 -04:00
Piotr Esden-Tempski 470f66f387 rtt: Cleaned up updated and improved the RTT usage documentation.
This resulted in a small addition to the drivers readme adding some
basic udev rule installation instructions.
2022-08-22 20:36:20 -04:00
Piotr Esden-Tempski 5cc2ff0f3a ch32f1: Correct the debug output format string. 2022-08-22 17:17:44 -04:00
dragonmux 81401ea1d7 rtt: Added missing licensing statements based on the rtt.c/rtt_if.c implementations 2022-08-22 12:59:24 -07:00
dragonmux f7b9c91c6d usb_serial: Dealt with how to build with ENABLE_RTT=1 2022-08-22 12:59:24 -07:00
dragonmux b02e305a70 aux_serial: Redone the LED status system and cleaned up the last of the old usbuart stuff 2022-08-22 12:59:24 -07:00
dragonmux 6747ad36d7 platforms: Removed the usbuart.h from across the platform impls as it was needless contamination 2022-08-22 12:59:24 -07:00