GDBug and other glitches

Executing our code from flash

Last week Sibille and I moved our bare-metal code for the processor-PCB (which so far was directly inserted in RAM by the GDB debugger) into the Flash memory proper, and wrote code that will execute from Flash to copy everything in RAM and continue execution from there.

However, we soon noticed a strange bug: the GDB debugger now ignored every breakpoint we tried to set in RAM (breakpoints to parts of the code executed in Flash before the copy to RAM still worked fine). After a lengthy debug session, Alexis determine that it‘s a bug from the GDB debugger and not from our code.… Read more

Bare-metal succes

Today, Sibille and I ran the final tests for the led-driving PCBs software using Vlaya’s SPI generation code. We wanted to make sure that if the main board sends an entire SPI frame (24 LED configuration instructions and a “TOP” command), the CPU managed to configure all the LEDs and turn them on. It does 🙂

On the nucleo devboard, we can observe 20 out of 24 timers. Have a look at the outputs we measured with the logic analyser : 

LEDs fired for two cycles (duty cycle proportional to LED ID)

Here is a link to the processor Reference manual.… Read more

Uncrossing wires

Today Sibille and I made great strides on the bare-metal code for the led-driving processors.

Debugging

Yesterday we left off unable to see the PWM outputs on the processor pins. Today we started by remedying an oversight: we set about configuring the clocks. 

On top of that, it turns out that yesterday we didn’t pay enough attention when reading the documentation for the board: the documentation includes pinout information for other boards with other processors, and we were looking at the wrong processor…

We were then able to use a Saleae Logic analyser to observe the PWM output. At first, the frequency was off, and we spent much time looking at our clock configuration before realising that the timer prescaler didn’t behave in the way we expected (it turns out that frequency division ration if the prescaler value plus one, which is a neat way of avoiding a “division by zero” type of situation). … Read more

Led’s bare-metal

Today we all brainstormed about the software architecture. 

Since we are still waiting to receive the Hall and optical sensors for the speed feedback aspects, we turned our attention to the rest of the Phyllo.

While Marc and Vlaya worked on how to organise the software for the main board – which they will tell you all about in an upcoming post – Sibille and I looked into the LED-driving PCBs. Their role is simple :

  • Receive color configuration for each LED and control commands via SPI as discussed in this post
  • Configure and control the timers to generate the appropriate PWM signals to light the LEDs

Since these tasks are simple enough, we plan to forego using an OS and instead write bare-metal code.… Read more