I can't run more then two task in ported freeRtos for AtMega328p controller for custom board - rtos

i have use Atmega328p controller and programming by eclipse AVR gcc tool chain setup.. now, i was make my Rtos code by change source file of freeRTOS.org websites.. now i can't run more then two task.. so, give me proper solution for that.. i was created my setup as per denoted in below link...
http://codeintherightway.blogspot.in/2015/06/freertos-on-arduino-uno-using-eclipse.html

By "can't run more than two tasks" do you mean the first two calls to xTaskCreate() succeed, but further calls to xTaskCreate() fail? If so then you have simple run out of heap space and the following page will help: http://www.freertos.org/a00111.html

Related

Porting of TwinCAT2 to TwinCTA3

I have a running project of twinCAT 2 (made for XP 32bit ) & Its working as required. Now I tried to port this project into TwinCAT3 (windows 10 64bit) for that->
I opened twinCAT 3 Created a new project.
Then add the existing project where I added ".tsm" file of TwinCAT2.
Then I added the PLC file (which have the main program & GUI also)
Then all the mapping for input and output & also changed a few settings in twinCAT for the device.
In the end, I build the program without having any errors.
Then finally I ran the TwinCAT3 program....
The problem I'm facing
If I'm clicking the RUN button TwinCAT3 is getting hanged (don't know the maybe time-related file is creating issue)
I'm not able to see data on GUI (Maybe GUI file not linked with the main program).
Please let me know if any solution you guys have.
Thanks :)
Porting TwinCAT2 plc project with a visualization to TC3 is sometimes a little tricky. You can try to just import the visualization pictures into the plc and let the engineering do the rest automatically (bind libs etc.). Or check the lib-versions of the visu libs manually. Or check the visualization profile in the plc-project properties. In both cases the slogan is "latest greatest" in this scope.
Is the connection to other data from the target also lost? E.g. the current cpu-usage of the cores? If yes, you have a other problem. Mostly endless loop.

Matlab openGL Warning

I'm tasked with upgrading a lot of legacy models and scripts made in an older version of Matlab/Simulink and have it running smoothly in R2018b. Among other requirements I'm not allowed to have any warnings issued upon execution of .m scripts or Simulink models. This is generally tedious but straightforward to comply.
However, there is a specific warning that Matlab does not give me hints on possible sources:
Warning: MATLAB has disabled some advanced graphics rendering features by switching to software OpenGL. For more information click here.
The link opens the Matlab Help page titled Resolving Low-Level Graphics Issues, which describes issues I'm not finding (or at least not noticing)
I do note that many scripts I run create and close figures, but this is done procedurally. I haven't been able to associate this warning with some specific function or feature. I'm working on a Windows Server machine.
Does anyone have an idea of how to narrow down which kind of function os Simulink block could cause this warning?
As datenwolf and Ander point out, the first thing to try is to update your drivers. If this doesn't work, and your only problem is that you're getting the warning but your graphics still render fine, then you have two other options to try.
First, you can simply modify your OpenGL rendering preferences using opengl. The following will set your preference to 'software' and save that setting for future sessions:
opengl('save', 'software');
Alternatively, you can just try to suppress that particular warning message. After you get the warning, issue this call to the warning function:
w = warning('query', 'last');
The w.identifier field will give you the ID for the warning message, which I believe will be 'MATLAB:hg:AutoSoftwareOpenGL' in this case. You can then add the following line to your startup.m file so that this warning is suppressed every time MATLAB is opened:
warning('off', 'MATLAB:hg:AutoSoftwareOpenGL');
Install the original vendor drivers for your GPU. The drivers that are installed by Windows by default lack full OpenGL support. Download the driver package directly from the website of Intel, AMD or NVidia, depending on what GPU you have.
If you don't have GPU, for example when running in a Virtual Machine, then you can not avoid that warning, because then Matlab has no other choice than falling back on the software OpenGL implementation that it ships with.
There's nothing you can do about that, other than making sure, that the system you're running Matlab on, does have proper OpenGL support!
It took me a long time to get it, so I'll put you here in case it helps how I managed to activate openGL in Linux:
If you haven't already (it's common for other problems), rename libstdc++ library from MATLAB:
mv _YOUR_MATLAB_ROOT_FOLDER_/sys/os/glnxa64/libstdc++.so.6 _YOUR_MATLAB_ROOT_FOLDER_/sys/os/glnxa64/libstdc++.so.6.bak
Create this link: sudo ln -s /usr/lib/x86_64-linux-gnu/dri/ /usr/lib/
Run export MESA_LOADER_DRIVER_OVERRIDE=YOUR_DRI_DRIVER;matlab -desktop -nosoftwareopeng
Your DRI Driver will be a file from /usr/lib/dri, removing "_dri" (in my case was the "radeons" driver for an AMD Vega graphic card.
Run MATLAB from a terminal using: export MESA_LOADER_DRIVER_OVERRIDE=_YOUR_DRIVER_HERE_;matlab -desktop -nosoftwareopengl. YOUR_DRIVER_HERE should be your driver, radeonsi in my case.
Check openGL with info = rendererinfo
If something went wrong, you will be able to see in the terminal which library was responsible. Executing 4) and 5) I was discovering what I had to correct, you can do the same if you have another problem that has not appeared to me.
So that it always runs correctly I put export MESA_LOADER_DRIVER_OVERRIDE=YOUR_DRI_DRIVER at the beginning of the script that runs matlab (_YOUR_MATLAB_FOLDER/bin/matlab), although I suppose it can also be set as an environment variable.
I hope this has been useful to you.

Command line arguments for Scratch 1.4

I'm using Scratch 1.4 for preparing a course for children.
The course is about controlling real devices (self built traffic lights, modified toys having motors, sensors, etc.)
For interfacing the hardware I'm using the Remote Sensor Protocol and the control-lines of a RS232 interface (3-in/3-out, all digital).
Everything works great, except small inconveniences:
The children have to do many steps manually:
start scratch first,
load a template project which enables remote sensor protocol and defines variables
accept the warning message notifying, that remote sensor protocol is enabled
start RSP-RS232 proxy
I'd like to simplify it by starting scratch from my tool, ask Scratch to perform steps 2,3 by command-line arguments and finally connect to the RSP port.
Is it possible?
If not, is it hard to implement these parameters in Smalltalk for someone with no Smalltalk experience (but other languages like C++)?
Thank you!
Ok, after some readings I could answer my question.
Bad news is: there is obviously no command line argument in Scratch passing a project-file as a start-project.
However good news is, it is not difficult to change the scratch for own needs. Several projects do it, e.g.:
Scratch 4 Arduino
Scratch GPIO
How to do it is described here:
http://wiki.scratch.mit.edu/wiki/Scratch_1.4_Source_Code
Scratch and Squeak
...
To get started, first copy the Scratch application ("Scratch.exe" or
"Scratch.app") from your normal Scratch folder into the Scratch source
code folder. (The Scratch application is actually just a Squeak
virtual machine, so any recent Squeak virtual machine should also
work.) Also, put copy of the Squeak source code file in that folder if
needed (this file is included in the zip file starting with the 1.4
source release). Finally, drop the file "ScratchSourceCode1.4.image"
onto the Scratch application. The Squeak programming environment will
start up, allowing you to view and modify the Scratch source code.
I was able to disable the dialogue notifying that remote sensors protocol is enabled
and to enable remote sensors at start by default. Took me 2 hours.
P.S.:
For those interested, I host my project here: https://github.com/vheinitz/Qratzfest
As I've found out, my Idea was not new (I've looked for this possibility about 3 years ago, but there was nothing). What is different, the proxy-tool is for PC, and is intended to use any hardware, not dedicated only to a specially firmwared Arduino or PI. Currently only control-pins of a serial interface are supported and linked to fixed names.
Soon it will provide the possibility to map any pin to any Scratch-variable.

Changing Code At Runtime While Debugging

I am using Eclipse Kepler Service Release 2 , EPIC 0.5.46 and Strawberry Perl 5 version 18 for perl programming. For debugging I am using Eclipse debugger and PadWalker .
I have an interactive perl program that writes to files based on answers provided by the users to multiple prompts. While debugging , every time i change a single line of code I have to rerun the whole program again and provide inputs to every prompt , which is really time consuming.
Is there a way to make changes to the code in a sub routine , in the middle of debugging session such that the instruction pointer resets itself to the first line of that sub routine. This way i do not have to restart the session to recompile the new code.
Appreciate your inputs and suggestions. Thank You!!!
What you want to do can be done, and I've done it many times in Perl myself. For example, see this.
However although what you describe may work (and is a bit dangerous), the way it is generally done a bit different and safer.
First one has to assume a regular kind of command structure like a command processor, or say a web server.
In a command processor or web server, you read a command (or get a web request), perform an action, then read another command, perform another action and so on. From your description, it sounds like you have such a structure.
In my case, I have each debugger command stored as in Perl file. This is helpful not only for facilitating this task, but also for understanding, testing and changing the code.
Given this kind of program structure, instead of trying to change the program counter, you complete the command and at the level where you are about to read a new command, you make the change and then reload the file which changes the code.
The specific Perl construct to do this is called do. Don't use require or use which will load in a Perl file only if that file or module hasn't been previously loaded. In your situation, you want to reload even if it has been loaded before.
So now how do you get to be able to issue a do command? As you suggest, you could do it through a debugger. Assuming you have this overall program stucture as described above, you put the breakpoint somewhere a common point in the caller which loops over things to process, rather than try to change things in indvidual commands.
And you don't even need a debugger to do this! Many web frameworks like Ruby on Rails, have a "development" mode where they save timestamps on files that implement functionality. If the file has changed they issue the "do" command before running the request.

Simulink stuck at "compiling: evaluating block parameters"

I am trying to run a model in Simulink, available for download here (direct).
I have been able to run it on a Linux machine, but on Windows it seems to get stuck at the compiling step. At the bottom of the screen I see two green bars, and the message "compiling: evaluating block parameters." It never goes beyond this.
I have tried choosing a compiler using the mex -setup process, but to be honest, I suspect this is not even close to what I need to do.
Any advice would be appreciated.