I’m not sure how to configure PlatformIO for the NXP’s LPC2148 MCU. I hope someone here can help.
I found one of maxgerhardt’s great repositories which supports PlatformIO on NXP LPC2134 microcontroller, but nothing for the LPC2148, the IDE documentation here does not give examples for these boards.
LPC2148 has same core as LPC2134, but has 512K flash memory, 32K RAM, plus 8K shared RAM with USB DMA.
Here’s maxgerhardt’s PlatformIO.ini file for LPC2134
[upload_settings]
; value will be read by python script. analogous to Makefile
FLASH_BAUD = 57600
MCU_CLOCK = 11059[env:lpc2134_01]
platform = nxplpc
; use custom board definition for NXP LPC 2134/01
board = lpc2134_01
; use same linkerscript as Makefile uses
board_build.ldscript = T-962-controller.ld
; remove default thumb mode flag
build_unflags = -mthumb
; reproduce build flags from Makefile
build_flags = -DNDEBUG -D__NEWLIB__ -fno-builtin -fmessage-length=0 -flto -ffat-lto-objects -Wl,-u_printf_float -Wl,-u_scanf_float
; add -nostdlib to linkerflags via script; cannot be done via build_flags in this case
; see Redirecting...
; also creates additional HEX file (otherwise only .elf and .bin are there, but uploader needs .hex)
; reproduce creation of version.c file, as Makefile does (could also work without, but why not…)
extra_scripts =
fix_linkflags.py
pre:create_version.py
custom_upload.py
; upload via custom lpc21isp program.
; precompiled binaries for Windows and Linux exist in this directory. Assume Windows by default
upload_protocol = custom
;if explicit upload port is needed (will be auto-detected otherwise)
;upload_port = COM1
I see in his source code files, he includes a file called LPC214x.h that looks to support all LPC2148 features. That’s good.
Also, his board file ( boards/lpc2134.json ) which is referenced in the PlatformIO.ini file, looks like this.
{
“build”: {
“cpu”: “arm7tdmi”,
“f_cpu”: “55296000L”,
“mcu”: “lpc2134”
},
“connectivity”: [
],
“debug”: {
“jlink_device”: “LPC2134”,
“pyocd_target”: “lpc2134”,
“svd_path”: “LPC176x5x_v0.2.svd”
},
“frameworks”: [
“mbed”
],
“name”: “NXP LPC2134/01”,
“upload”: {
“maximum_ram_size”: 16384,
“maximum_size”: 131072,
“protocol”: “mbed”,
“protocols”: [
“jlink”,
“blackmagic”,
“cmsis-dap”,
“mbed”
]
},
“url”: “Single-chip 16/32-bit microcontrollers; 32/64/128/256/512 kB ISP/IAP flash with 10-bit ADC and DAC | NXP Semiconductors”,
“vendor”: “NXP”
}
Is this just informational, or does PlatformIO need it when generating the firmware hex file?