[Solved] Getting PlatformIO working for Pokitto

vs code is a fork from atom there both code editors and got a wide list of packages to highlight and get back debug info from compilers for breakpoints, debug highlighting and more

im most likely going to end up using visual studio code cuz the intelisence system (if it can parse the pokitto lib) is going to be the killer feature

Aparently VSCode isn’t a fork of Atom.

Both VSCode and Atom are made with Electron and designed to look and behave somewhat similarly, but they don’t intentionally share any code (except for the Electron stuff).

interesting did not know that, they do look allot alike and there always put in the same boat, plugins seem to be compatible (assume thats due to electron and just being javascript) i have played around with monaco (the text editor rendering visual studio code uses)

i had seen that vscode is source is more leaning on typescript (cuz ofcourse its Microsoft)
still think vscode is the better deal to use (although i guess now that microsoft bought github they also own the atom project)

I like Typescript.
The lack of static typing is one of the things I most dislike about JavaScript.

Technically they own the repo and possibly the copyright,
but they don’t really ‘own’ the code because it’s MIT-licenced.

No time for an actual update now, but FYI Pokitto Lib is now installable from PIO / Home / Libraries by searching “Pokitto”

1 Like

Ah, I was looking in the wrong sections.
I was looking at boards and platforms.

Probably won’t test it properly tonight, but I might have a quick run to confirm that it works.

Got it all installed all right, but couldn’t get the code to compile out of the box:

#include "My_settings.h"
^~~~~~~~~~~~~~~
compilation terminated.
*** [.pioenvs\lpc11u68\lib01c\Pokitto_ID5600\FONTS\font3x3.o] Error 1
*** [.pioenvs\lpc11u68\lib01c\Pokitto_ID5600\FONTS\font3x5.o] Error 

(Several times over.)

But the fact I’m even getting that error means that something’s probably working.


Scratch that, I realised I missed the plaformio.ini and pokitto_pre.py files.
After adding those:

Archiving .pioenvs\lpc11u68\lib01c\libPokitto_ID5600.a
Linking .pioenvs\lpc11u68\firmware.elf
Building .pioenvs\lpc11u68\firmware.bin
Checking size .pioenvs\lpc11u68\firmware.elf
Memory Usage -> http://bit.ly/pio-memory-usage
DATA:    [==        ]  18.6% (used 6868 bytes from 36864 bytes)
PROGRAM: [=         ]  13.1% (used 34276 bytes from 262144 bytes)
=================== [SUCCESS] Took 9.41 seconds ===================

Success!!!

1 Like

Yes, those are the key to the whole thing. They patch mistakes in startup_lpc11u68.c and add @FManga s automatic CRC checksum into the linker file

1 Like

ok i think i got it working

is there a way to run like a script after compile to like copy the firmware.bin to like a bin folder or with upload to overide the firmware in CRP_DISABLD?

also tested it on the mac and seems to work fine to, but the bin file is in a hidden folder wich might be a little awkward for some beginners

here a fix for that with the old command file trick

pokittoIO.command :

#!/bin/sh
clear
echo "drag n' drop\033[1;32m pokitto project\033[0m and press enter"
read PROJ
cp $PROJ/.pioenvs/lpc11u68/firmware.bin /Volumes/CRP\ DISABLD/firmware.bin
diskutil unmount /Volumes/CRP\ DISABLD

dont forget to use chmod +x /path/to/pokittoIO.command to make this file work

hah! you finally see the light! :smiley:

Thank you for your perseverance @jonne and @Pharap !

I’m just a little confused getting a hello-world to run. Where do we put the platformio.ini and pokitto_pre.py? I see in PokittoIO they are in a subdir called platformio.ini, but this doesn’t work either.

I’d say ideally we should only have this in the users platformio.ini:

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

And then have the needed main.cpp and My_settings.h in src/.
Is that what it should look like?

1 Like

Ok read the README and followed the instructions (tiny bit more work than I’d like for a beginning user), but we got SUCCES on the pio run which is a great feeling :smiley:

So what are the steps now to upload the build to the pokitto?

What OS are you on?

I’m using Linux.

Ah, you just copy the firmware.bin that is in .pioenvs/lpc11u68/ to the sd-card :slight_smile:

If you want to copy directly to the device, you can use:
mcopy -o -i /dev/sdX path/to/bin ::/firmware.bin
You’ll have to find out what dev your Pokitto shows up as.

Ah check. Only thing there is that you need to have su-rights to write to the block device.
So for most users a copy of the bin to the sd-card is easiest probably.

So, this is exactly the kind of experience I was hoping for Pokitto! Platform-agnostic easy install of a toolchain.
Already 2 cross-platform editors (and infinite if you just use the commandline tools) available and it just works™

Hope to finally start coding some stuff for the pokitto soon, thank you again @jonne and @Pharap for pushing this through! :smiley:

2 Likes

I know it’s possible to configure it so you don’t need su, but then you’d need su to do that. Copying to the sd, unmounting, taking the SD out, putting it in the pokitto, turining it on, finding the file in the loader, waiting… it gets old pretty fast if you’re trying to code something.
I’d expect most users to be able to use sudo on their own machines, so it shouldn’t be that much of a problem?

I think something went wrong with the audio recording
It seemed fine on computer but is really low on phone :s

4 Likes

Yeah the volume is extremely low.

Maybe overdub with some fresh audio perhaps?
and/or onscreen text to explain the steps.

Nice tutorial for the beginner (although maybe a smaller desktop resolution could be clearer).