[Solved] Using PlatformIO for compilation


#21

Both. The IDE acts as a command line wrapper.


#22

ok so i fiddled with it and it compiled but idk where the bin files are stored


#23

nevermind i found a bin and it did not work even though it said it compiled promerly, not sure whats going on


#24

The binary needs the crc checksum updated as a postbuild step with lpcrc.exe:

Source code here:


#25

urg an exe isnt going to work on mac


#26

That’s why @jonne linked to bit with the source code.
Unfortunately it uses a makefile, but in fairness it’s a pretty straightforward one.


#27

ok i got it compiled
so this needs the firmeware.bin as an argument and then it should work on pokitto?


#28

The exact commands that EmBitz runs on post-build are:

arm-none-eabi-objcopy.exe -I ihex .\build\hello.hex -O binary .\build\hello.bin
.\build\lpcrc .\build\hello.bin

The first turns the generated .hex file into a .bin file.
The second is the call to lpcrc.


#29

arg i hate this .pioenvs hidden files crap i just cant find where they store the elf and bin file
edit: ok found it


#30

i did ./lpcrc firmware.bin
it gave me ``succesfully updated crc to: efff6a2d```
still not useable for pokitto


#31

Please post binary. I will take a look with a hex editor. I know what its supposed to look like inside

Edit: ARM Cortex-M0+ dictates a certain structure for the binary. If it is completely wrong, I can see it. It begins with SP then PC (first instruction address) followed by checksum followed by IRQ handlers. Pokitto IRQ handlers should be fairly identical between binaries


#32

firmware.bin (37.4 KB)

edit: i kinda get that, but theres allot here thats going on of whats supposed to happen and its bit of a pain.
why every chip even though they have the same core cpu have completely different toolchains is beyond me


#33

It looks ok but checksum in the binary is EFFF5CA7


#34

the checksum it gave me was efff6a2d
still happend to have the terminal window open


#35

I wasnt able to find that checksum at all by searching


#36

wierd, idk im probebly doing everything wrong


#37

I dont think so. Otherwise the binary looks exactly like it should.

Edit: run lpcrc in dosbox :wink: ?


#38

dont be crazy


#39

has anyone made a platformio project?

heres my platformio.ini file

[platformio]
build_dir = pokitto

[env:lpc11u68]
platform = nxplpc
board = lpc11u68
framework = mbed

build_flags =
    -I Pokitto
    -I Pokitto/POKITTO_HW
    -I Pokitto/POKITTO_CORE
    -I Pokitto/POKITTO_LIBS
    -I Pokitto/libpff


#40

what are the pin names called in mbed? i cant find it and if its p0_9 or something it gives this thing is driving me nuts i cant get a simple blinking light to work on this platform was not declared in this scope