Port for Arduino Due? #6784
Replies: 1 comment
-
Posted at 2017-09-08 by ThomasChr Maybe this Thread should be moved to "Porting to new devices", sorry! Posted at 2017-09-08 by @gfwilliams No problem! Just moved! I saw someone was looking at porting to the Adafruit M0 boards, which are Atmel SAMD based as well (albeit with a different ARM core): https://twitter.com/todbot/status/902991546089226240 As far as I know nobody has tried it, but you're right - it should be pretty straightforward. Since there's software I2C, SPI and PWM now you could get something pretty usable just by implementing UART, timer and GPIO support. Posted at 2017-09-09 by ThomasChr Hi Gordon, thanks for the hint. I think I'll give it a try.
I've already done 1-3, so I'm moving forward now. If you would like to give me any tipps, or want me to post a tutorial afterwards, just tell me. Thomas PS: Became a patreon member today. I think your work is amazing. And keeping such a close (and friendly!!!) look on the forums is also amazing. Even when you consider that the guys porting espruino to other devices kind of stealing your money because you sell less from your own boards... PPS: I also have Making Things Smart on my kindle. Easy read with some new ideas! Good work! Posted at 2017-09-11 by @gfwilliams Nice, thanks! It might be worth looking at something like the EFM32 port - that's a very basic port of Espruino so there shouldn't be too much confusing in there... But basically you'll want:
And that's it I think - probably the most important thing is to get your blink-prog working with the serial (or USB?) port... Once you can have access to the REPL on Espruino debugging will be a lot easier! Posted at 2017-09-11 by ThomasChr Okay, I've managed to gather all the required files for a build from the Arduino IDE and put them here: https://tclinux.de/due.tar.gz A simple Testprogram looks like that:
You can compile it with:
So step 4 is done. Now I'm trying to modify Espruino to compile for the Arduino Due. If anyone wants to help, feel free to do so. Thomas Credits: Arduino IDE Posted at 2017-09-11 by @allObjects Test program testing what? Posted at 2017-09-11 by ThomasChr Simply blinking a LED on the Due. #include "../include/due_sam3x.init.h" You can transfer the file firmware.bin with the included program (under tools) 'bossac':
Posted at 2017-09-11 by @allObjects Ic; with that test program you validate your tool chain setup... and now comes the hard work to enable Espruino coding... ;-) Posted at 2017-09-12 by ThomasChr Okay, I don't fear the hard work, so heres my plan.
Is this the right way to go? The one thing which is hard work seems to be 'jshardware.js' because to me it looks that this is the hardware dependent interface. Am I correct? Thomas PS: Yes, a long way to go.. :-) Posted at 2017-09-12 by @gfwilliams Sounds like a good plan... Yes, you're right - once it's compiling pretty much all your work will be in Just some ideas:
Ahh - sorry about the badge. It's still a slightly manual process (I have to get a list of Patreons and a list of emails of forums users and use that when I build the site). I'll do it again today though. Posted at 2017-09-12 by ThomasChr Hello Gordon, okay. I think that helps me a lot. I'll try to go on and will cry for help if I'm really stuck :-) Nevermind the badge, it's not important! Posted at 2017-09-12 by ThomasChr If anyone wants to follow my silly attempts to get the Arduino Due to fly, here you go: https://github.com/ThomasChr/Espruino/tree/duedev Brach: duedev Posted at 2017-09-15 by ThomasChr We have a blinking LED! Posted at 2017-09-15 by @gfwilliams Wow, that's great! I reckon you want:
Hope that helps! Once you have the UART going it becomes quite fun, since you can debug and test using the REPL Posted at 2017-09-15 by ThomasChr Hi Gordon, thanks! Posted at 2017-09-19 by ThomasChr I've got a REPL, I've got Pin Functions (Config, Get, Set) for the first Pin (the onboard LED). I think we can call it Alpha Status :-) Next would be to get the setTimeout running by implementing jshGetSystemTime with the build-in RTC. Then I need to enter all possible pins (all 54!) and make the Pin Functions for them. Thats a lot of work, but not very complicated anymore. Posted at 2017-09-19 by Wilberforce Good progress! Posted at 2017-09-20 by ThomasChr We now have access to all pins (I counted 63 Pins - impressive) and the SystemTimer for setInterval() and setTimeout() is working - kind of. Not very accuracte. I'm on it. If someone wants to have a go, here are the Bin-Files: https://www.thomaschristlieb.de/wp-content/uploads/2017/09/espruinoduebin.tar.gz I think after getting a real accurate Time (better than one Second!) I'm trying to get save() to Work... Posted at 2017-09-26 by ThomasChr So... 'save()' is working now. It's not super reliable though. I think I need to make some debugging. Posted at 2017-10-02 by @gfwilliams That's absolutely awesome news - thanks! Looks really exciting - do you think it's in a state where you could give me a PR and we could get it into the main Espruino repo? Posted at 2017-10-04 by ThomasChr Hi Gordon! I think the code is kind of ready - setWatch is missing, also PWM, ADC and more UARTs - so a few things are left to do. But the included library is large (and also does include some manuals), so I think first I need to tidy up a little bit. Thomas Posted at 2017-10-04 by @allObjects @ThomasChr - amazing work. I guess now comes the 20% accounting for 500% of the effort...
What are the ramification for that for applications? Posted at 2017-10-09 by ThomasChr I've made a PR to discuss my code: espruino/Espruino#1255 The large lib is not a problem of code size on the due. It's ~250 MBs of Code in the Espruino Repo. Posted at 2017-10-09 by @gfwilliams Thanks! But wow - 2000 files! I might see about skinning that down before merging - there seem to be quite a few docs/examples/libraries/etc in the Atmel libraries. Posted at 2017-10-09 by @gfwilliams Merged now - thanks! Do you have a Twitter account I can reference when I mention it? I imagine this will be pretty big news - I guess I need to get an Arduino Due now :) Posted at 2017-10-10 by ThomasChr Hey Gordon, thats great news! I'm not that into Social Media, but @DieSchatzjger is my not so often used Twitter Account :-) Thomas Posted at 2017-10-10 by @gfwilliams Cool, thanks! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-09-08 by ThomasChr
The Arduino Due Board has a Cortex M3 Processor and more flash and Ram than the original Espruino Board. You can get a clone for around 20$, original about 40$.
It should not be that hard to port Espruino, has anyone tried it yet?
Anyone interested?
Here are the specs, it has some nice stuff built in like CAN: https://store.arduino.cc/usa/arduino-due
Thomas
Beta Was this translation helpful? Give feedback.
All reactions