Quality RTOS & Embedded Software

 Real time embedded FreeRTOS RSS feed 
Quick Start Supported MCUs PDF Books Trace Tools Ecosystem


Loading

ModBus TCP/RTU Bridge (Interrupt troubles)

Posted by stucmath on February 27, 2014

I use FreeRTOS for our ModBus TCP/RTU Bridge (STM32F107). The ModBus-TCP alone with the LWIP Stack is working fine. The same applies to the Modbus RTU alone. But when I use them together, the System hangs after a few seconds. I'm pretty sure this has something to do with my interrupt setting. But at the moment I have no idea what I'm doing wrong. I am glad for any help.

Thanks in advance.

Mathias Stucki


ModBus TCP/RTU Bridge (Interrupt troubles)

Posted by rtel on February 27, 2014

Which version of FreeRTOS are you using. If it is V7.6.0 or later then ensure configASSERT is defined as it will trap common interrupt priority misconfigurations, especially on STM32 parts.

Regards.

Attachments

FreeRTOSConfig.h (7178 bytes)
alternate (3013 bytes)
main.c (6172 bytes)
mbportserial.c (20531 bytes)
stm32_lwip.c (20040 bytes)

ModBus TCP/RTU Bridge (Interrupt troubles)

Posted by stucmath on February 27, 2014

Thank your for the fast response. Now i have defined the configASSERT but it doesn't trap into the vAssertCalled function. Actually, the code stops at this position: (I have increased the Stack but without success)

# /* *** NOTE *********************************************************** If you find your application is crashing here then likely causes are: 1) Stack overflow - see http://www.freertos.org/Stacks-and-stack-overflow-checking.html 2) Incorrect interrupt priority assignment, especially on Cortex-M3 parts where numerically high priority values denote low actual interrupt priories, which can seem counter intuitive. See configMAXSYSCALLINTERRUPT_PRIORITY on http://www.freertos.org/a00110.html 3) Calling an API function from within a critical section or when the scheduler is suspended, or calling an API function that does not end in "FromISR" from an interrupt. 4) Using a queue or semaphore before it has been initialised or before the scheduler has been started (are interrupts firing before vTaskStartScheduler() has been called?). See http://www.freertos.org/FAQHelp.html for more tips. **********************************************************************/

	for( pxIterator = ( xListItem * ) &( pxList->xListEnd ); pxIterator->pxNext->xItemValue <= xValueOfInsertion; pxIterator = pxIterator->pxNext ) /*lint !e826 !e740 The mini list structure is used as the list end to save RAM.  This is checked and valid. */
	{
		/* There is nothing to do here, we are just iterating to the
		wanted insertion position. */
	}

Attachments

FreeRTOSConfig.h (7178 bytes)
alternate (3013 bytes)
main.c (6172 bytes)
mbportserial.c (20531 bytes)
stm32_lwip.c (20040 bytes)


[ Back to the top ]    [ About FreeRTOS ]    [ Privacy ]    [ Sitemap ]    [ ]


Copyright (C) Amazon Web Services, Inc. or its affiliates. All rights reserved.

Latest News

NXP tweet showing LPC5500 (ARMv8-M Cortex-M33) running FreeRTOS.

Meet Richard Barry and learn about running FreeRTOS on RISC-V at FOSDEM 2019

Version 10.1.1 of the FreeRTOS kernel is available for immediate download. MIT licensed.

View a recording of the "OTA Update Security and Reliability" webinar, presented by TI and AWS.


Careers

FreeRTOS and other embedded software careers at AWS.



FreeRTOS Partners

ARM Connected RTOS partner for all ARM microcontroller cores

Espressif ESP32

IAR Partner

Microchip Premier RTOS Partner

RTOS partner of NXP for all NXP ARM microcontrollers

Renesas

STMicro RTOS partner supporting ARM7, ARM Cortex-M3, ARM Cortex-M4 and ARM Cortex-M0

Texas Instruments MCU Developer Network RTOS partner for ARM and MSP430 microcontrollers

OpenRTOS and SafeRTOS

Xilinx Microblaze and Zynq partner