groufosse wrote on Friday, June 13, 2014:
Hi, and thank you again for bearing with me on this. A lot of pain with the STM HAL library stuff…Yes, I agree and understand what you are seeing/saying from the above. It appears that way as I was modifying things to see if I could get it to work, but essentially, here’s what I did. I used STM’s cube to generate a timer example with FreeRTOS “middlewares” as they call it. All generated examples now use the HAL calls, which are poorly documented and has no example of what the steps are to set up a timer with an interrupt handler.
To answer your question:the define for configASSERT is NOT commented and should be callable, but have not seen this happen.
In any case, I took the FreeRTOSConfig.h file, and the “.s” startup file, and planted them into my code, including timer initialization routine they had. In their example, I can breakpoint the call to the handler. With identical code in mine, it does not want to break.
So, I guess the above is not really a question (timer setup) for this forum. The question is, will using FreeRTOS “xPortSysTickHandler” interfere with the peripheral timer (Timer 6)? (I would say not from your comments so far)
Below is what my startup file NOW looks like, and below that is the FReeRTOSConfig.h. If I comment OUT the define for the xPortSysTickHandler, as shown, the scheduler will not run.
If I need to do some detailed reading to understand what’s going on fully, please point me to where that is. I’ve already successfully installed and ran FreeRTOS8 on a CortexM3 LPC1768, and have peripheral interrupts there. Never had these problems…no hair left on head…
startup file code slice
MODULE ?cstartup
;; Forward declaration of sections.
SECTION CSTACK:DATA:NOROOT(3)
SECTION .intvec:CODE:NOROOT(2)
EXTERN __iar_program_start
EXTERN SystemInit
PUBLIC __vector_table
DATA
__vector_table
DCD sfe(CSTACK)
DCD Reset_Handler ; Reset Handler
DCD NMI_Handler ; NMI Handler
DCD HardFault_Handler ; Hard Fault Handler
DCD MemManage_Handler ; MPU Fault Handler
DCD BusFault_Handler ; Bus Fault Handler
DCD UsageFault_Handler ; Usage Fault Handler
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD 0 ; Reserved
DCD SVC_Handler ; SVCall Handler
DCD DebugMon_Handler ; Debug Monitor Handler
DCD 0 ; Reserved
DCD PendSV_Handler ; PendSV Handler
DCD SysTick_Handler ; SysTick Handler
; External Interrupts
FreeRTOSConfig.h code slice
/* The lowest interrupt priority that can be used in a call to a "set priority"
function. */
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 15
/* The highest interrupt priority that can be used by any interrupt service
routine that makes calls to interrupt safe FreeRTOS API functions. DO NOT CALL
INTERRUPT SAFE FREERTOS API FUNCTIONS FROM ANY INTERRUPT THAT HAS A HIGHER
PRIORITY THAN THIS! (higher priorities are lower numeric values. */
#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 5
/* Interrupt priorities used by the kernel port layer itself. These are generic
to all Cortex-M ports, and do not rely on any particular library functions. */
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
/* !!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
/* Normal assert() semantics without relying on the provision of an assert.h
header file. /
/ USER CODE BEGIN 1 /
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); }
/ USER CODE END 1 */
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
standard names. */
#define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler
/* IMPORTANT: This define MUST be commented when used with STM32Cube firmware,
to prevent overwriting SysTick_Handler defined within STM32Cube HAL */
//#define xPortSysTickHandler SysTick_Handler
#endif /* FREERTOS_CONFIG_H */