[Solved] Using PlatformIO for compilation

Not sure what you mean with ‘normal’, but in this case it seems there is a specific issue with mbed for NXP targets within PIO.
Hope someone more knowledgable about PIO-internals can fix this.

Do note that PIO is complicated because they aim to have as many platforms/frameworks/boards/libraries as they can with a single frontend. Quite ambitious if you ask me.

Technically PlatformIO isn’t really an IDE, it’s a sort of middleman between the IDE and the compiler.

Traditionally an IDE (i.e. a ‘normal’ IDE) either directly manipulates the compiler or uses makefiles.

I suppose in a way PlatformIO is kind of like another modern attempt at a better makefile, with mixed results - great for some platforms, not quite as great for others.

I never claimed it’s an IDE :wink:

I’d call it a ‘unified toolchain’ or something. Anyway, those interested lets continue here: [Solved] Using PlatformIO for compilation

1 Like

I agree. And I put in a pretty serious effort to try to get it working. I still think its one of the priorities to get it fixed.

1 Like

I was addressing what a ‘normal’ IDE is.

I’ve moved all the PlatformIO specific parts.

At long last, we have PlatformIO!
Thanks to @jonne and his perseverance.

1 Like

:slight_smile: maybe we should give @jonne a special badge for that…

3 Likes

I have “lost” to one technical device my entire life. It was a Hewlett-Packard all-in-one inkjet printer & scanner. It decided that even legitimate ink cartridges were invalid. I went through a long process of actually flipping the machine to another geographical region using the non-public service manual and thereby reset the anti-copycat ink cart mechanism.

Immediately after I got it to recognize my ink cartridge, it threw a paper feed controller error.

I took that spawn of the devil outside and put it out of its misery. Edit: and disposed the 10000 pieces correctly in a recycling center.

2 Likes

(Woops, I came back to this thread 10 days later and discovered I had an unposted comment…)


Printers are evil in general.

I’ve heard some companies actually program them to refuse to print when the ink drops below a certain level, even if the remaining ink is enough to print with.

(Fun fact: it was a xerox printer that prompted Richard Stallman to start the free software movement.)


I agree with @sbmrgd though, we should give you one of the wizard badges for your work on getting PlatformIO running.
(And @FManga, if his Code::Blocks hack works - I haven’t got round to testing it.)

Nice story, I currently have a similiar situation. I work with a cnc cutter that is operated using HPGL and visual basic 6. This is open for me to change and adapt as i please. So i added features and repaired bugs on it.

However the next machine is using custom software(according to them) that can only be altered by them.

1 Like

I’ve had a couple of printers in the past, that even if you set it to print in black only, will refuse to print if one of the colours is too low, even though you specifically set it not to use colour.

1 Like

That sucks.
I don’t like VB6, but it’s better than nothing.


Yep, we’ve had at least one of those.
And the ink is stupidly expensive.
These days they put microchips in the ink cartridges to stop people refilling them.

Printer manufacturers are the real evil :P

1 Like

Hi
I have ported a simple game to Pokitto. It runs in the simulator, and compiles on mbed online and in EmBitz as well.
However building in platform.io throws this error:
.platformio\packages\framework-mbed/platform/mbed_retarget.cpp:1326: undefined reference to `__HeapLimit’

If I set #define PROJ_ENABLE_SYNTH to 0 it compliles fine.

Any idea? Please heeelp! :slight_smile:

here is the repo: https://github.com/x-labz/circular-pacman

It compiled fine on my copy.

Have you gone to .platformio/packages/framework-mbed/platformio/variants/LPC11U68 and made sure that you have:

        "c": [
            "-std=c11"
        ], 

And

        "cxx": [
            "-std=c++11", 
            "-fno-rtti", 
            "-Wvla"
        ], 

If that doesn’t fix it,
I’ll try updating my version to see if it’s something that broke recently.


By the way, what’s with get_buttons? Did you find the Pokitto buttons API confusing?

And I’m confused as to why you’ve got a circle function when the Pokitto library already has Display::fillCircle(x0, y0, r) (which should actually be faster).

Also just to check, you know Pokitto is compiled with C++ and not C, right?

Hi,
thank you for the quick response!
The game is ‘just’ ported from C with minimal effort, thats the reason of the confusing things you mentioned.
Anyway, where to check the settings you have recommended? I feel a little bit lost in this platformio jungle…
cheers
DSz
circular-pacman

4 Likes

Ah ok, that makes sense.
I thought it was a game you’d been working on from scratch.

Most of the stuff that gets ported to Pokitto is from Gamebuino or a similar Arduino environment,
and they naturally use C++, so it’s unusual to see C code being ported.

If you’re on Windows then by default the settings file should be in %USERPROFILE%/.platformio/packages/framework-mbed/platformio/variants/LPC11U68.
(If you’re on Mac or Linux then ~/.platformio/packages/framework-mbed/platformio/variants/LPC11U68 should be the equivalent.)

I’m not sure about Windows 7 and earlier, but on Windows 8 (and presumably 10) you should be able to just put that in the address bar of the file browser and it will take you to the right folder.

Then you want to edit LPC11U68.json and look for lines similar to what I posted before and change them so they match what I posted.
Speciflcally look for "c": [ and "cxx": [.

I’ve tried the recommended changes in LPC11U68.json, no success, build still fails.
Then I reinstalled the mbed framework ( 4.2.0 ) and the Pokitto lib ( 0.0.5 )
now it builds

Building .pio\build\lpc11u68\firmware.bin
Memory Usage -> http://bit.ly/pio-memory-usage
DATA: [======== ] 80.6% (used 29728 bytes from 36864 bytes)
PROGRAM: [== ] 22.2% (used 58180 bytes from 262144 bytes)

I attach the .bin, can someone check whether it works on real hardware? I don’t have Pokitto ( yet )
firmware.bin (58.2 KB)

1 Like

Unfortunately, it does not work.

I will try building your source also

EDIT: most likely a CRC error. The linker needs to add a CRC checksum that signifies the binary is correct.

@Pharap, did you try your compiled .bin on hardware ?

Platformio core update , again

GitHub

platformio run failes due to "cannot move location counter backwar…

This issue occurs after I updated platformio-core up-to date. It seems any nxplpc boards that has few RAM (4KB) occurs this issue. (In fact, any program I wrote for lpc1114fn28 generates same error…

or nxplpc update

“Hi @iwaita2ya! Indeed, it looks like you are out of RAM. Are you able to compile your project using mbed-cli tool? You can try to use an older version of the platform (3.5.0 with mbed 5.10.1):”

[lpc1114fn28] platform = nxplpc@3.5.0 framework = mbed board = lpc1114fn28

Got it to build successfully

EDIT: need to test binary now

EDIT2: does not run, apparently because nxplpc platform has changed somehow again