Skip to content

assertion "!(num < MIN_EXCEPTION_NUM || num >= MAX_EXCEPTION_NUM)" failed #1861

@carlk3

Description

@carlk3

Running FreeRTOS, if I specify PARAM_ASSERTIONS_ENABLE_ALL=1 I get an assertion at:

SysTick_Handler@0x100001ca (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_crt0/crt0.S:91)
<signal handler called>@0xfffffff9 (Unknown Source:0)
vTaskExitCritical@0x10015fae (/home/carlk/pi/pico/FreeRTOS-Kernel/tasks.c:7161)
xTaskResumeAll@0x1001658c (/home/carlk/pi/pico/FreeRTOS-Kernel/tasks.c:4072)
xEventGroupSetBits@0x1001403e (/home/carlk/pi/pico/FreeRTOS-Kernel/event_groups.c:630)
vPortLockInternalSpinUnlockWithNotify@0x10013c52 (/home/carlk/pi/pico/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/port.c:1062)
mutex_exit@0x20000754 (/home/carlk/pi/pico/pico-sdk/src/common/pico_sync/mutex.c:215)
stdio_usb_out_chars@0x1001b96a (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_stdio_usb/stdio_usb.c:130)
stdio_out_chars_crlf@0x1001ae2c (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_stdio/stdio.c:82)
stdio_stack_buffer_flush@0x1001ae5e (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_stdio/stdio.c:185)
stdio_buffered_printer@0x1001aea6 (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_stdio/stdio.c:194)
_out_fct@0x10019a7a (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_printf/printf.c:148)
_vsnprintf@0x1001ab32 (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_printf/printf.c:823)
vfctprintf@0x1001ac8c (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_printf/printf.c:898)
__wrap_vprintf@0x1001b122 (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_stdio/stdio.c:328)
__wrap_printf@0x1001b154 (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_stdio/stdio.c:350)
__assert_func@0x1001ad66 (/home/carlk/pi/pico/pico-sdk/src/rp2_common/pico_clib_interface/newlib_interface.c:164)
check_exception_param@0x1001745c (/home/carlk/pi/pico/pico-sdk/src/rp2_common/hardware_exception/exception.c:42)
exception_set_exclusive_handler@0x1001748a (/home/carlk/pi/pico/pico-sdk/src/rp2_common/hardware_exception/exception.c:51)
xPortStartSchedulerOnCore@0x10013a66 (/home/carlk/pi/pico/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/port.c:324)
xPortStartScheduler@0x10013b0c (/home/carlk/pi/pico/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/port.c:385)
vTaskStartScheduler@0x10016204 (/home/carlk/pi/pico/FreeRTOS-Kernel/tasks.c:3710)
main@0x100012fa (/home/carlk/pi/pico/FreeRTOS-FAT-CLI-for-RPi-Pico/examples/command_line/src/main.cpp:26)

At

static inline void check_exception_param(__unused enum exception_number num) {
    invalid_params_if(HARDWARE_EXCEPTION, num < MIN_EXCEPTION_NUM || num >= MAX_EXCEPTION_NUM);
}

num = SYSTICK_EXCEPTION. It looks like SYSTICK_EXCEPTION is not less than MAX_EXCEPTION_NUM, and the check objects to that.

enum exception_number {
    // Assigned to VTOR indices
    MIN_EXCEPTION_NUM = 2,
    NMI_EXCEPTION = 2,        ///< Non Maskable Interrupt
    HARDFAULT_EXCEPTION = 3,  ///< HardFault Interrupt
    SVCALL_EXCEPTION = 11,    ///< SV Call Interrupt
    PENDSV_EXCEPTION = 14,    ///< Pend SV Interrupt
    SYSTICK_EXCEPTION = 15,   ///< System Tick Interrupt
    MAX_EXCEPTION_NUM = 15
};

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions