So I want and need to try abstracting interrupts on my own and would like to start slowly with the LED(Blinky example) stuff, without using any framework.
I’m using the LPC1768 MCB
How do I remove the framework value from the platformio.ini file correctly?
I’d like to do everything with the basic LPC17xx.h file?
Do I need anything else for that?
Removal of the framework =
line should cause the _bare.py
builder to kick in. It should just use the startup file and you’ll have to define your own main()
(may be with extern "C"
declaration if it’s C-linkage)
Without any framework you’ll need to put this file and its dependencies in the project yourself, either src/
or inc/
I’m getting another checksum mismatch.
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nxplpc/lpc1768.html
PLATFORM: NXP LPC 4.4.0 > NXP mbed LPC1768
HARDWARE: LPC1768 96MHz, 64KB RAM, 512KB Flash
DEBUG: Current (custom) On-board (cmsis-dap) External (blackmagic, jlink)
PACKAGES: toolchain-gccarmnoneeabi 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> http://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 0 compatible libraries
Scanning dependencies...
No dependencies
Checking size .pio/build/lpc1768/firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [= ] 9.8% (used 6440 bytes from 65536 bytes)
PROGRAM: [=== ] 29.3% (used 153853 bytes from 524288 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, custom, jlink, mbed
CURRENT: upload_protocol = custom
Uploading .pio/build/lpc1768/firmware.bin
xPack OpenOCD, 64-bit Open On-Chip Debugger 0.10.0+dev (2019-07-17-15:21)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : CMSIS-DAP: SWD Supported
Info : CMSIS-DAP: JTAG Supported
Info : CMSIS-DAP: FW Version = 1.0
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 0 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 10 kHz
Info : SWD DPIDR 0x2ba01477
Info : lpc17xx.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : Listening on port 3333 for gdb connections
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x1fff0080 msp: 0x10001ffc
Info : High speed (adapter_khz 12500) may be limited by adapter firmware.
** Programming Started **
Warn : Verification will fail since checksum in image (0xb8be2715) to be written to flash is different from calculated vector checksum (0xb8be2718).
Warn : To remove this warning modify build tools on developer PC to inject correct LPC vector checksum.
** Programming Finished **
** Verify Started **
Error: checksum mismatch - attempting binary compare
embedded:startup.tcl:449: Error: ** Verify Failed **
in procedure 'program'
in procedure 'program_error' called at file "embedded:startup.tcl", line 494
at file "embedded:startup.tcl", line 449
*** [upload] Error 1
Super weird. I uninstalled the brew stuff
brew remove platformio open-ocd
And it seems to work properly.
Be aware that only header files must be in inc/
, the .c
files won’t be compiled at my knowledge. (looking at https://github.com/jxsl13/lpc1769_blinky_example/tree/raw_blinky/include/LPC1768, safer to move all of it into src/
)
Weird. You will want to look at the first 7 4-byte blocks of the .bin
and maybe manually calculate the checksum (which is in the 8th block) in python to confirm the result (hexdump -C -n 32 firmware.bin
). The logic is here: https://github.com/basilfx/lpc_checksum/blob/master/lpc_checksum.py#L10-L16