STM32F103C8T6 I2C halting with "priority prder violation" Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: barthess, RoccoMarco

ManWithACrowbar
Posts: 3
Joined: Thu Dec 18, 2025 5:42 pm
Been thanked: 1 time

STM32F103C8T6 I2C halting with "priority prder violation"  Topic is solved

Postby ManWithACrowbar » Fri Dec 19, 2025 2:20 pm

Hello, everyone. I was trying to implement a simple I2C scanner using ChibiOS v. 7.0.5 on STM32F103C8T6 using custom build environment (CMake-based). I ran into issue, when I try to scan the bus, chSysUnlock() in i2cReleaseBus fails on assert "priority order violation". I do not understand, what am I doing wrong, since I am not using any locking in my own code whatsoever. Could anyone please help me resolve the issue? Code can be accessed by link: https://github.com/PortiaLabiata/katetris. Thanks!

User avatar
Giovanni
Site Admin
Posts: 14779
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1174 times
Been thanked: 976 times

Re: STM32F103C8T6 I2C halting with "priority prder violation"

Postby Giovanni » Fri Dec 19, 2025 3:05 pm

You are getting a ready list corruption probably caused by invalid API usage, try enabling the "state checker" in chconf.h and verify if there are context violations.

Giovanni

ManWithACrowbar
Posts: 3
Joined: Thu Dec 18, 2025 5:42 pm
Been thanked: 1 time

Re: STM32F103C8T6 I2C halting with "priority prder violation"

Postby ManWithACrowbar » Fri Dec 19, 2025 4:17 pm

Thank you for your reply. State checking is already enabled and doesn't seem to fire (as I understand, it is supposed to halt system in case of a context violation, but halt happens from here:
► Show Spoiler

User avatar
Giovanni
Site Admin
Posts: 14779
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1174 times
Been thanked: 976 times

Re: STM32F103C8T6 I2C halting with "priority prder violation"

Postby Giovanni » Fri Dec 19, 2025 6:19 pm

Check for possible stack overflows also, try increasing stacks and see if there is change.

Giovanni

ManWithACrowbar
Posts: 3
Joined: Thu Dec 18, 2025 5:42 pm
Been thanked: 1 time

Re: STM32F103C8T6 I2C halting with "priority prder violation"

Postby ManWithACrowbar » Fri Dec 19, 2025 6:34 pm

I found the issue, appearently I forgot to divide sizeof of int array by sizeof(int), which caused loop to go over a huge chunk of RAM, likely corrupting ready list in the process. Thank you, please close the thread.


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 27 guests