phryk
New member
I'm currently working on a LED lighting project (4x 15W RGB+CW+WW)
and a friend recommended the Teensy 4 because it's one of the few µC
boards that actually has enough hardware PWM channels for this purpose.
Now, I already did a very similar thing, but without CW+WW about a decade
back where I coopted an Arduino Mega to work without the Arduino IDE and
language, but just used raw C with the avr-gcc/avrdude toolchain.
For this updated version, I got myself a Teensy 4.1 and am planning to go
about this the same way. Raw C, no OS, no Arduino.
I'm on FreeBSD and won't use any tool that's not FOSS.
I already figured out that to flash new firmware, I need teensy_loader_cli.
Builds fine on FreeBSD and with the bundled .hex I could also verify that
this works without problems. So far, so good.
Now I'm at the state where I would need to write and build my first "hello world"
firmware for the Teensy and I'm a bit confused. I have limited but passable C
experience, but less with embedded systems and none with ARM or Teensy.
With AVR, some toolchain package contained header files defining the supported
µCs with their registers. But for ARM cross-compilation I found no such headers
in any of the involved packages (binutils, gcc, newlib).
I'm also a bit confused that I didn't find any information about raw C on the Teensy
on this forum – maybe I just searched for the wrong terms?
Anyhow, while the "normal" ARM toolchain doesn't seem to come with µC definition
headers, I have found this thing called CMSIS. It does come with definition headers,
but the documentation of that thing is so confusing that I'm not actually sure what the
hell CMSIS *is*.
If anyone could help me clear some of this confusion and get to a state where I can
write, compile and flash the equivalent of the slow_blink firmware in raw C, I would
be much obliged.
Additionally, I would be extra grateful for help configuring UART serial-over-USB and
those weird FlexPWM things so I can actually communicate with the Teensy and have
it route 20 PWM channels to the output pins.
and a friend recommended the Teensy 4 because it's one of the few µC
boards that actually has enough hardware PWM channels for this purpose.
Now, I already did a very similar thing, but without CW+WW about a decade
back where I coopted an Arduino Mega to work without the Arduino IDE and
language, but just used raw C with the avr-gcc/avrdude toolchain.
For this updated version, I got myself a Teensy 4.1 and am planning to go
about this the same way. Raw C, no OS, no Arduino.
I'm on FreeBSD and won't use any tool that's not FOSS.
I already figured out that to flash new firmware, I need teensy_loader_cli.
Builds fine on FreeBSD and with the bundled .hex I could also verify that
this works without problems. So far, so good.
Now I'm at the state where I would need to write and build my first "hello world"
firmware for the Teensy and I'm a bit confused. I have limited but passable C
experience, but less with embedded systems and none with ARM or Teensy.
With AVR, some toolchain package contained header files defining the supported
µCs with their registers. But for ARM cross-compilation I found no such headers
in any of the involved packages (binutils, gcc, newlib).
I'm also a bit confused that I didn't find any information about raw C on the Teensy
on this forum – maybe I just searched for the wrong terms?
Anyhow, while the "normal" ARM toolchain doesn't seem to come with µC definition
headers, I have found this thing called CMSIS. It does come with definition headers,
but the documentation of that thing is so confusing that I'm not actually sure what the
hell CMSIS *is*.
If anyone could help me clear some of this confusion and get to a state where I can
write, compile and flash the equivalent of the slow_blink firmware in raw C, I would
be much obliged.
Additionally, I would be extra grateful for help configuring UART serial-over-USB and
those weird FlexPWM things so I can actually communicate with the Teensy and have
it route 20 PWM channels to the output pins.