Modbus Master Stack On ATSAME54 With RTOS embedded by neudeep - September 7, 2019September 7, 20190 In previous post we discussed about how to port modbus slave stack on ATSAME54. This post we will discuss on how to port modbus master stack on SAME microcontroller. You can download example freemodbus master stack for reference from FreeModbus. We have referred the 'AT91SAM7X_FREETROS' example project. You can follow the steps from previous post for creating directory of project files. Instead of modbus slave stack, add modbus master stack. In addition, We are using FreeRTOS in our project. So In top level directory we have added FreeRTOS V9.0.0 . Please refer to modifications in port specific files described in previous post. So lets begin with issues while port modbus master stack on SAME, Without an operating systems there are
How To Use Two Timers In Same Project embedded by blog_1buq8n - July 29, 2019August 22, 20210 If you are using SAM series controller you probably have came across this question, How do i implement two timer which generate two interrupt at different time in same project? or How we can use two timer in same project in SAME54 controller? Well SAM series controller are ARM-based MCUs and MPUs from ATMEL now Microchip. We are using ATSAME54P20A ie SAME54 explained pro board to evaluate the functionality of it. So created new project using start.atmel.com with TC0 and TC1 along with WDT and interrputs. The project tree looks as below, This project works well and TC0 timer interrupt is working but TC1 timer interrupt is not working. Following is code for initialization and using
How To Write RTOS Safe ISR For ATSAME embedded by blog_1buq8n - July 26, 2019August 22, 20210 In our application it is required to use FreeRTOS API functions from an interrupt service routine(ISR). Good thing about FreeRTOS is it has provided interrupt safe API, meaning one can use FreeRTOS API functions from ISR, as they have provided two versions of some API. Functions intended for use from ISRs have “FromISR” appended to their name eg. xQueueSendFromISR How to set correct priority levels if I want to call an ISR-safe function from interrupt? Because the maximum level of configKERNEL_INTERRUPT_PRIORITY is 1 and the minimum preemption Priority level of any interrupt source e.g. and edge interrupt is 15. That means it is above the max. level of configKERNEL_INTERRUPT_PRIORITY. In our application we were using xQueueSendFromISR() from IRQ10 ie 'EIC_10_IRQn', to
How To Use WDT On Free RTOS Running ATSAMEx embedded by blog_1buq8n - July 24, 20190 After doing some google and spending almost 4 hours on choosing right place to start WDT, we have decided to share our learning here. Well we are using ATSAME54P19/20 controller from Microchip formally Atmel. Watchdog timer - WDT works well without Free RTOS (10.0) but when WDT is enabled along with RTOS it simply does not work well. In big while(1) embedded applications with no RTOS you can always initialize WDT after peripheral initialization and feed/touch WDT in while/main loop. In case of RTOS there are multiple tasks/threads and to be specific in case for Free RTOS when you try to enable WDT right before vTaskStartScheduler(); call it simply does not work. Tried with following solutions - like configure
How To Mock Local Variable In Ceedling embedded by neudeep - May 17, 2019August 30, 20210 In embedded system product development there are quite number of tools and framework for unit testing the C code. In this blog post I will explain about how to mock local variable in ceedling for unit testing. Ceedling is one of the widely used open source framework for your test driven product development (TDD) in embedded systems. What is Ceedling 'Ceedling' is open source framework used in unit testing, in our project which involves embedded system development we are using 'ceedling' framework. Ceedling works together with Unity and CMock. Both are are open source tools for testing C code. Ceedling has feature of automatic generation of mock. Read more about ceedling features in our previous blog post. Unit Testing Tools Unit