Skip to content
Thymio 2 firmware
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
cmake-microchip @ 6b5f87b CMake build script (#29) Jan 12, 2018
hex
log Update log decoding tool to new binary format Aug 6, 2013
molole @ 37f74e4 CMake build script (#29) Jan 12, 2018
sd Fix compilation on linux Mar 14, 2013
usb_pic24 CMake build script (#29) Jan 12, 2018
.dockerignore Dockerfile for MPLABX toolchain (#31) Jan 12, 2018
.gitignore add wireless nodeID settings Nov 24, 2015
.gitmodules Update submodules Apr 18, 2018
CMakeLists.txt Persist uuid and name in device memory. (#42) Aug 14, 2018
Capture-XC16-as.PNG create readme.md Sep 6, 2017
Capture-XC16-gcc.PNG
Capture-XC16-ld.PNG create readme.md Sep 6, 2017
Capture-XC16.PNG create readme.md Sep 6, 2017
Dockerfile Dockerfile for MPLABX toolchain (#31) Jan 12, 2018
Jenkinsfile Jenkinsfile using containerized MPLABX (#34) Jan 12, 2018
abo.c relax test of id to be compatible with wireless Thymio Nov 24, 2015
abo.h Add missing headers Dec 2, 2011
analog.c ir_prox: Change collision behavior Oct 7, 2013
analog.h Add software timer, change motor nameing Nov 1, 2011
behavior.c New accelerometer LIS2DE12 (#48) Feb 7, 2019
behavior.h add setting mode structure (replace pairing mode) May 28, 2015
button.c Change button treshold, inhibit and init behavior. Optimise some divi… May 21, 2012
button.h add volume control setting mode May 28, 2015
cmake.md update doc (#37) Jan 16, 2018
crc.c Fix compilation on linux Mar 14, 2013
crc.h Add missing headers Dec 2, 2011
entry.s entry.s: conditionally disable bootloader Mar 14, 2013
ground_ir.c improve behavior of calibration to prevent starting problem Oct 11, 2017
ground_ir.h ir_prox: Add communication support Aug 2, 2013
ir_prox.c clear ir.comm when disabling it Nov 24, 2015
ir_prox.h format to replace whitespaces into tab and May 28, 2015
leds.c fix bug shift register Jun 25, 2018
leds.h change the visual of the setting mode May 28, 2015
leds_low.s
lis2de12.c
lis2de12.h New accelerometer LIS2DE12 (#48) Feb 7, 2019
log.c Persist uuid and name in device memory. (#42) Aug 14, 2018
log.h
main.c add new binaries V13 Mar 12, 2019
memory_layout.h Persist uuid and name in device memory. (#42) Aug 14, 2018
mma7660.c
mma7660.h
mode.c change auto-calibration for ground sensor not store in settings but r… Sep 6, 2017
mode.h rename function pulse_get() May 28, 2015
motor.c motor: add calibration support Jun 10, 2014
motor.h motor: add calibration support Jun 10, 2014
ntc.c Add NTC online calibration support Oct 24, 2011
ntc.h
p24FJ128GB106.gld Fix linker script for xc16 Mar 26, 2013
pid_motor.c
pid_motor.h motor: add calibration support Jun 10, 2014
playback.c Change sound timing Dec 6, 2011
playback.h
pmp.c Fix compilation on linux Mar 14, 2013
pmp.h Add license headers, bugfix and prepare for release May 13, 2011
pwm_motor.c Fix compilation on linux Mar 14, 2013
pwm_motor.h Add license headers, bugfix and prepare for release May 13, 2011
rc5.c
rc5.h Add license headers, bugfix and prepare for release May 13, 2011
readme.md correct links and remove i2c/slave Sep 13, 2018
regulator.c Recompile with new aseba + bugfix Mar 26, 2012
regulator.h Add license headers, bugfix and prepare for release May 13, 2011
rf.c New accelerometer LIS2DE12 (#48) Feb 7, 2019
rf.h New accelerometer LIS2DE12 (#48) Feb 7, 2019
sd.c implementation of sound.duration function Sep 6, 2017
sd.h implementation of sound.duration function Sep 6, 2017
sensors.c
sensors.h ir_prox: Change collision behavior Oct 7, 2013
skel-usb-user.c Led as variable (#47) Dec 5, 2018
skel-usb-user.h Led as variable (#47) Dec 5, 2018
skel-usb.c Read & set RF settings through a device info (#49) Feb 7, 2019
skel-usb.h Persist uuid and name in device memory. (#42) Aug 14, 2018
sound.c ir_prox: improve sound filtering Nov 28, 2013
sound.h ir_prox: improve sound filtering Nov 28, 2013
test.h Add license headers, bugfix and prepare for release May 13, 2011
test_mode.c test_mode: Improve timing Jun 10, 2014
thymio-buffer.c adapt firmware to latest aseba master and c99 style Sep 6, 2017
thymio-buffer.h adapt firmware to latest aseba master and c99 style Sep 6, 2017
thymio_natives.c fix sound.freq description and improve sound generation calculation Feb 25, 2019
thymio_natives.h add function to setup wireless module Nov 6, 2018
tone.c fix sound.freq description and improve sound generation calculation Feb 25, 2019
tone.h Allow aseba to change the tone generator wave Oct 26, 2011
usb_uart.c format to replace whitespaces into tab and May 28, 2015
usb_uart.h Add test mode (not tested) Mar 23, 2011
wav.c implementation of sound.duration function Sep 6, 2017
wav.h

readme.md

Compiling Thymio firmware

Source code

To compile the firmware from git, you need the following source code:

Tools

You need the MPLAB X environment and C compiler:

Compilation

You can compile using two methods, one using CMake (only compiling) or used the Microchip MPLAB X tool

CMake

Follow compilation instructions

Use MPLAB X

First, you need to start MPLAB X and create a new project:

  • Microcontroller: PIC24FJ128GB106
  • Compiler: XC16
  • Hardware tool: None (simulator, or whatever).

Use the linker script provided in the aseba-target-thymio2 git tree.

Use the following sources:

  • from aseba-target-thymio2 git tree, almost everything except skel-usb-user.c/h:

    abo.c, analog.c, behavior.c, button.c, crc.c, entry.s, ground_ir.c, ir_prox.c, leds.c, leds_low.s, log.c, main.c, mma7660.c, mode.c, motor.c, ntc.c, pid_motor.c, playback.c, pmp.c, pwm_motor.c, rc5.c, regulator.c, rf.c, sd/ff.c, sd/mmc.c, sd.c, sensors.c, skel-usb.c, sound.c, test_mode.c, thymio-buffer.c, thymio_natives.c, tone.c, usb_uart.c, wav.c

  • from usb_pic24 folder:

    usb_descriptors.c, usb_device.c, usb_function_cdc.c

  • from aseba git tree:

    vm/natives.c, vm/vm.c, transport/buffer/vm-buffer.c

  • from molole git tree:

    clock/clock.c, error/error.c, flash/flash.c, i2c/i2c.c, i2c/master.c, i2c/master_protocol.c, timer/timer.c

Note that if you want to edit the firmware, you should add the following two files from the aseba-target-thymio2 git tree as "Important files": skel-usb-user.c, skel-usb-user.h. You should not compile them directly, as they are included from skel-usb.c/h. The reason is that skel-usb.c/h is target-independent code, while skel-usb-user.c/h is target-dependent code.

Project setup:

  • Define common macros: ASEBA_LIMITED_MESSAGE_SIZE;ASEBA_ASSERT
  • Compiler options: * -Os -mlarge-code -fomit-frame-pointer -fno-strict-aliasing*
  • On, linux add: -fno-peephole2, because of a compiler bug (official workaround from microchip).
  • Add molole, usb_pic24, aseba git tree, and aseba-target-thymio2 as include search path.

Here are screenshots of the detailed options you should set in the project properties:

Then you should be able to compile the firmware. To upload it to the robot, use the Thymio firmware upgrader and not a program such as icd3 or pickit3.

You can’t perform that action at this time.