STM32F103C8T6 I2C halting with "priority prder violation" Topic is solved
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
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!
- 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"
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
Giovanni
-
ManWithACrowbar
- Posts: 3
- Joined: Thu Dec 18, 2025 5:42 pm
- Been thanked: 1 time
Re: STM32F103C8T6 I2C halting with "priority prder violation"
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
- 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"
Check for possible stack overflows also, try increasing stacks and see if there is change.
Giovanni
Giovanni
-
ManWithACrowbar
- Posts: 3
- Joined: Thu Dec 18, 2025 5:42 pm
- Been thanked: 1 time
Re: STM32F103C8T6 I2C halting with "priority prder violation"
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.
Who is online
Users browsing this forum: No registered users and 27 guests
