Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
compiling-v2-dev [2017/02/13 13:59] 186.206.156.184 |
compiling-v2-dev [2017/09/03 21:02] (current) 51.6.19.28 [Toolchain installation] |
||
---|---|---|---|
Line 25: | Line 25: | ||
Then we need to install the ARM GCC Toolchain. | Then we need to install the ARM GCC Toolchain. | ||
- | For this you can use the classic Smoothie method, or the repositories : | + | For this you use the repositories : |
+ | We want a version >= gcc version 6.3.1 20170620 | ||
=== From the repositories | === From the repositories | ||
Line 35: | Line 35: | ||
</code> | </code> | ||
- | === Using the Smoothie script | ||
- | |||
- | Smoothie has a script to grab the toolchain you might be used to ( see [[http://smoothieware.org/compiling-smoothie|compiling smoothie]] ), here is how to use it : | ||
- | |||
- | <code> | ||
- | wget https://raw.githubusercontent.com/Smoothieware/Smoothieware/edge/linux_install | ||
- | chmod +x linux_install | ||
- | ./linux_install | ||
- | ./BuildShell | ||
- | </code> | ||
== Cloning NuttX | == Cloning NuttX | ||
Line 222: | Line 212: | ||
<code> | <code> | ||
- | JLinkGDBServer -device LPC4337_M4 -endian little -if JTAG -speed 10000 -localhostonly | + | JLinkGDBServer -device LPC4330_M4 -endian little -if JTAG -speed 10000 -localhostonly |
arm-none-eabi-gdb -ex "set target-charset ASCII" -ex "set print pretty on" -ex "target remote :2331" -ex "set mem inaccessible-by-default off" nuttx | arm-none-eabi-gdb -ex "set target-charset ASCII" -ex "set print pretty on" -ex "target remote :2331" -ex "set mem inaccessible-by-default off" nuttx | ||
</code> | </code> | ||
Line 229: | Line 219: | ||
* arm-none-eabi-gdb connects to JLinkGDBServer via a TCP/IP socket on port 2331. It can then be used in a fashion similar to how MRI has been used to debug Smoothie firmware in the past. | * arm-none-eabi-gdb connects to JLinkGDBServer via a TCP/IP socket on port 2331. It can then be used in a fashion similar to how MRI has been used to debug Smoothie firmware in the past. | ||
- | It is possible to use GDB and the JLinkGDBServer to upload code into the LPC4337 via JTAG. I see upload speeds of >1MiB/sec when using this method. | + | It is possible to use GDB and the JLinkGDBServer to upload code into the LPC4330 via JTAG. I see upload speeds of >1MiB/sec when using this method. |
From within GDB, you can issue the following commands to upload the binary contents of the specified .elf file into the microcontroller and start it executing again from a clean reset. | From within GDB, you can issue the following commands to upload the binary contents of the specified .elf file into the microcontroller and start it executing again from a clean reset. | ||
Line 279: | Line 269: | ||
sleep 1 | sleep 1 | ||
./bin/lpcscrypt -d /dev/ttyACM0 resetCore | ./bin/lpcscrypt -d /dev/ttyACM0 resetCore | ||
+ | </code> | ||
+ | |||
+ | == Verifying NuttX Initialization == | ||
+ | |||
+ | You flashed the nuttx.bin firmware inside Bambino 200E board, now you can see the NuttX initialization over serial. | ||
+ | |||
+ | Just connect the USB/Serial board to Gadgeteer Slot 5 (label: "KU X") and use some serial console terminal like "minicom" with the USB/Serial device file detected by Linux (use dmesg to see it, normall will be /dev/ttyUSB0) and configure it to 115200 8n1 to get access to NuttX prompt. | ||
+ | |||
+ | Press the "RESET" button near USB1 connector and you will see the NuttX initialization: | ||
+ | |||
+ | <code> | ||
+ | NuttShell (NSH) | ||
+ | nsh> | ||
+ | </code> | ||
+ | |||
+ | Type "help" or "?" to see the available commands: | ||
+ | |||
+ | <code> | ||
+ | nsh> ? | ||
+ | help usage: help [-v] [<cmd>] | ||
+ | | ||
+ | [ cmp false mkdir rm true | ||
+ | ? dirname free mh rmdir uname | ||
+ | basename dd help mount set umount | ||
+ | break df hexdump mv sh unset | ||
+ | cat echo kill mw sleep usleep | ||
+ | cd exec ls ps test xd | ||
+ | cp exit mb pwd time | ||
+ | |||
+ | Builtin Apps: | ||
+ | nsh> | ||
</code> | </code> | ||
Line 302: | Line 323: | ||
== Testing USB | == Testing USB | ||
+ | |||
+ | You can test USB on Bambino board using these steps: | ||
+ | |||
+ | <code> | ||
+ | cd ~/nuttxspace/nuttx/tools | ||
+ | ./configure.sh bambino-200e/usbnsh | ||
+ | cd .. | ||
+ | make | ||
+ | </code> | ||
+ | |||
+ | Flash the nuttx.bin firmware as explained before and connect a USB cable on USB0 port and to your PC. | ||
+ | |||
+ | Reset the board, you will see in the "dmesg" of Linux that it created the USB/Serial device as ttyACM0. Configure the minicom to use /dev/ttyACM0 115200 8N1. | ||
+ | |||
+ | Press Enter three times in the minicom to start the NuttX Shell. | ||
+ | |||
+ | == Testing SD Card == | ||
TODO | TODO |