Skip to content

Conversation

@crasbe
Copy link
Contributor

@crasbe crasbe commented Oct 15, 2025

Contribution description

The Pull Request #10290 introduced the drivers/motor_driver, which added a global motor configuration to boards/common/nucleo64 and boards/common/native. The latter even included a qdec simulation (although very specialized for the motor driver case).

IMO this really shouldn't be global because not all Nucleo Boards would ever be used with the motor driver and

I had to change the driver API because the driver itself relied on the motor_driver_config being global, it was not a parameter for the motor functions. While changing that, I noticed that the motor_driver parameter of all the motor functions was redundant.

The only place that "bit" me was in the QDEC simulation on Native, but I added a check to regain the index.
To be honest I'm not super sure how or if the indexing worked previously though...

Testing procedure

It builds?

Even on master the motor driver test currently does not work and the output is unchanged for this PR.

cbuec@W11nMate:~/RIOTstuff/riot-guides/RIOT$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
cbuec@W11nMate:~/RIOTstuff/riot-guides/RIOT$ BOARD=native make -C tests/drivers/motor_driver/ all term
make: Entering directory '/home/cbuec/RIOTstuff/riot-guides/RIOT/tests/drivers/motor_driver'
using BOARD="native64" as "native" on a 64-bit system
Building application "tests_motor_driver" for "native64" with CPU "native".

"make" -C /home/cbuec/RIOTstuff/riot-guides/RIOT/boards
...
"make" -C /home/cbuec/RIOTstuff/riot-guides/RIOT/sys/ztimer
   text    data     bss     dec     hex filename
  42397    1528   59392  103317   19395 /home/cbuec/RIOTstuff/riot-guides/RIOT/tests/drivers/motor_driver/bin/native64/tests_motor_driver.elf
/home/cbuec/RIOTstuff/riot-guides/RIOT/dist/tools/pyterm/pyterm -ps /home/cbuec/RIOTstuff/riot-guides/RIOT/tests/drivers/motor_driver/bin/native64/tests_motor_driver.elf --process-args tap0
2025-10-15 17:40:08,139 # RIOT native interrupts/signals initialized.
2025-10-15 17:40:08,140 # TZ not set, setting UTC
2025-10-15 17:40:08,140 # RIOT native64 board initialized.
Welcome to pyterm!
Type '/exit' to exit.
2025-10-15 17:40:08,141 # RIOT native hardware initialization complete.
2025-10-15 17:40:08,141 #
2025-10-15 17:40:08,141 # ztimer_init(): ZTIMER_TIMER using periph timer 0, freq 1000000, width 32
2025-10-15 17:40:08,141 # ztimer_init(): ZTIMER_USEC without conversion
2025-10-15 17:40:08,142 # main(): This is RIOT! (Version: 2024.04-devel-3561-g5afe64)
2025-10-15 17:40:08,142 # gpio_dir0 init failed
2025-10-15 17:40:08,142 # motor_driver_init failed with error code -5
2025-10-15 17:40:08,142 # tests/drivers/motor_driver/main.c:81 => failed condition
2025-10-15 17:40:08,142 # *** RIOT kernel panic:
2025-10-15 17:40:08,142 # CONDITION FAILED.
2025-10-15 17:40:08,142 #
2025-10-15 17:40:08,142 # *** halted.
2025-10-15 17:40:08,143 #
2025-10-15 17:40:08,143 #
2025-10-15 17:40:08,143 # native: exiting

This PR:

cbuec@W11nMate:~/RIOTstuff/riot-guides/RIOT$ git checkout pr/remove_common_motor_driver
Switched to branch 'pr/remove_common_motor_driver'
cbuec@W11nMate:~/RIOTstuff/riot-guides/RIOT$ BOARD=native make -C tests/drivers/motor_driver/ all term
make: Entering directory '/home/cbuec/RIOTstuff/riot-guides/RIOT/tests/drivers/motor_driver'
using BOARD="native64" as "native" on a 64-bit system
Building application "tests_motor_driver" for "native64" with CPU "native".

"make" -C /home/cbuec/RIOTstuff/riot-guides/RIOT/boards
...
"make" -C /home/cbuec/RIOTstuff/riot-guides/RIOT/sys/ztimer
   text    data     bss     dec     hex filename
  41584    1552   59392  102528   19080 /home/cbuec/RIOTstuff/riot-guides/RIOT/tests/drivers/motor_driver/bin/native64/tests_motor_driver.elf
/home/cbuec/RIOTstuff/riot-guides/RIOT/dist/tools/pyterm/pyterm -ps /home/cbuec/RIOTstuff/riot-guides/RIOT/tests/drivers/motor_driver/bin/native64/tests_motor_driver.elf --process-args tap0
2025-10-15 17:40:48,766 # RIOT native interrupts/signals initialized.
2025-10-15 17:40:48,767 # TZ not set, setting UTC
Welcome to pyterm!
Type '/exit' to exit.
2025-10-15 17:40:48,767 # RIOT native64 board initialized.
2025-10-15 17:40:48,768 # RIOT native hardware initialization complete.
2025-10-15 17:40:48,768 #
2025-10-15 17:40:48,768 # ztimer_init(): ZTIMER_TIMER using periph timer 0, freq 1000000, width 32
2025-10-15 17:40:48,768 # ztimer_init(): ZTIMER_USEC without conversion
2025-10-15 17:40:48,768 # main(): This is RIOT! (Version: 2024.04-devel-3563-g16de4c-pr/remove_common_motor_driver)
2025-10-15 17:40:48,769 # gpio_dir0 init failed
2025-10-15 17:40:48,769 # motor_driver_init failed with error code -5
2025-10-15 17:40:48,769 # tests/drivers/motor_driver/main.c:85 => failed condition
2025-10-15 17:40:48,769 # *** RIOT kernel panic:
2025-10-15 17:40:48,769 # CONDITION FAILED.
2025-10-15 17:40:48,769 #
2025-10-15 17:40:48,769 # *** halted.
2025-10-15 17:40:48,769 #
2025-10-15 17:40:48,769 #
2025-10-15 17:40:48,769 # native: exiting

Issues/PRs references

Rabbithole I fell into when looking into the static errors of #21337... (see #21337 (comment) ).

@crasbe crasbe added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR labels Oct 15, 2025
@github-actions github-actions bot added Platform: native Platform: This PR/issue effects the native platform Area: tests Area: tests and testing framework Area: drivers Area: Device drivers Area: boards Area: Board ports labels Oct 15, 2025
@riot-ci
Copy link

riot-ci commented Oct 15, 2025

Murdock results

✔️ PASSED

ab99e51 fixup! fixup! drivers/motor_driver: make motor configuration non-global

Success Failures Total Runtime
10548 0 10548 12m:52s

Artifacts

@crasbe
Copy link
Contributor Author

crasbe commented Oct 16, 2025

Oh ffs... I just found that this is essentially a duplicate of #20429 🫠

@crasbe crasbe closed this Oct 16, 2025
@crasbe crasbe deleted the pr/remove_common_motor_driver branch October 30, 2025 16:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: boards Area: Board ports Area: drivers Area: Device drivers Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Platform: native Platform: This PR/issue effects the native platform Process: API change Integration Process: PR contains or issue proposes an API change. Should be handled with care. Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants