beckus / qemu_stm32

QEMU with an STM32 microcontroller implementation

Home Page:http://beckus.github.io/qemu_stm32/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FreeRTOS issue with NVIC registers

AleksandrVin opened this issue · comments

When using cmsis_rtos_v2 or v1 implementation generated from STM32CubeMX execution asserts on "obtained from hardware parameter. I can't understand what causes this but it is certainly incorrect and manual variable modification helps this code to pass. This code works on real bluepill stm32.

File: port.c from cmsis_rtos_v2

		#ifdef configPRIO_BITS
		{
			/* Check the FreeRTOS configuration that defines the number of
			priority bits matches the number of priority bits actually queried
			from the hardware. */
			ulMaxPRIGROUPValue = 3; // qemu is broken here. was 4294967295
			configASSERT( ( portMAX_PRIGROUP_BITS - ulMaxPRIGROUPValue ) == configPRIO_BITS );
		}
                #endif

I assume that ulMaxPRIGROUPValue is incorrect. Due to an error in NVIC register values.
This one probably

volatile uint8_t * const pucFirstUserPriorityRegister = ( volatile uint8_t * const ) ( portNVIC_IP_REGISTERS_OFFSET_16 + portFIRST_USER_INTERRUPT_NUMBER );

Hello @AleksandrVin, thank you for reporting this issue and providing details.
At the moment, I am not set up to troubleshoot this, and probably will not be able to help. Best of luck, and if you have any additional details, please feel free to post and/or submit a patch to fix the issue.
Thank you, and sorry I am not of more help.