Why does my STM32F407 discovery flashed software take effect after replugging the cable? - embedded

I'm using Keil to flash the software to on stm32f407 discovery.
But the software only starts working when I pullout the JLINK cable and plug it again.
Why is that?

By default uVision holds the target in RESET after flashing with the the Download (F8) function. I would argue that this is a safety feature - if your code controls some electro-mechanical system for example you might not want it to start-up spontaneously.
You can change this behaviour via Flash->Configure Flash Tools->Settings...
Alternatively if you load by running the debugger, it will start-up and by default breakpoint at main() - that default can be changed to run straight through. Any explicitly set breakpoints will cause a halt of course.

Related

Is STM32f429 discovery board fully supported on qemu?

I'm trying to emulate STM32F429I discovery board using qemu & eclipse IDE. I got the blinky example running with the led turning on and off on the graphics screen but I have tried an example to run the on-board screen and it doesn't seem to be running, Is it supported? Also, many drivers fail when simulated with qemu (sdram, rcc, ...) How can I know exactly what peripherals that are fully supported?
Here's the part of documentation about the board, What is meant by "FP not emulated" anyway?

STM32CUBEIDE st link gdb debug error in final launch sequence

So, I am learning stm32 mcus, using a nucleo f4 board.
Everything was working fine and now debug launch fails.
Actually, I was doing one debug, closed it and next debug session won't launch.
It starts debug on Linux or on Windows with OpenOCD, but ST-Link GDB debug fails (gdb does work on linux).
This is the error message:
Already did allow the stlink server in the windows firewall.
Avast antivirus was deleting the STLINK server exe file, added an exception and it works.
Also the problem is the mass storage option (that allows use the explorer to grab directly the hex files) and makes conflicts with the ide. I solved the problem using explorer and ejecting the board, then debugger goes fine.

Running a program written for freeRTOS (RTOS) in virtualmachine as a binary

I got a simple program written for freeRTOS (implements a timer).
I want to run this program in an empty virtual machine (VirtualBox, or QEMU, or something else).
I need to make a binary file that can run in and empty VM.
Any advice or direction of how can i do this?
I checked many stuff on freeRTOS homepage but couldn't find something useful.
For virtual box, you will need a binary of freeRTOS that is x86 or amd64 compatible. Check if this is of any benefit for you.
You can check this link, as I understand it's a simulator for freeRTOS which may enable you to test it without a virtual machine.
For QEMU, check this link
Emm..., if you need run just binary file without any OS started you can use qemu for that. Just pass your binary through option '-bios' into qemu. And after qemu will start it to run. Also use '-S -s' options in for enabling gdb server in qemu. After you can connect to qemu with gdb client and debug you binary step by step.

Raspberry Pi shutdown destroys file system

I trying to write a small c program witch reads out an GPIO pin to shutdown the pi externally. The triggering of the signal is working well. The program is started by LXDE as autostart application. If the program detects the shutdown signal it's performing:
sync();
system("halt");
Why does this program damage my ext4 file system after a couple of reboots. There is no fixed number of reboots necessary to damage the system. I don't see any difference by writing halt to command line. I'm using the newest version of the firmware(last update today) and also the kernel is up to date(last update today).
Does anybody have an good idea about it?
This app is a good idea, i wonder nothing like this is already existing...
I think the problem is the "halt" command.
You shuold use the explicit command "shutdown -h now" instead.
For further reading see Anthony Lawrence

How do I use the Silicon Laboratories IDE with SDCC?

I'm thinking about using a microcontroller with an 8051 core from Silicon Laboratories.
I hope that I can use C rather than assembly language, so I installed SDCC.
I installed the "Silicon Laboratories IDE" to download the executable binaries to the on-chip Flash program memory.
It also supposedly can be set up (under the Project > Tool Chain Integration menu)
to use "any" 8051 compiler.
I tried to set it up to use SDCC, but every time I hit the "Assemble/Compile File" button it tells me
"Compiler process did not sucessfully complete."
How do I get new C code I write onto the SiLabs C8051F310 chip?
Is there a web site with a step-by-step HOWTO?
(Would it be easier to use a MAKEFILE that calls SDCC, only using the "Silicon Laboratories IDE" for the very last step of downloading the executable binary to the chip?)
Start with Silicon Labs Application Note 198 - INTEGRATING SDCC 8051 TOOLS INTO THE SILICON LABS IDE*. It is written for an older version of the IDE, but the general configuration should remain the same. It is probably important to note that AN198 needs updating for SDCC 3.0.0. Additional information from the Silicon Labs MCU User Forum or Microcontrollers Knowledge Base may prove useful as well.
The SDCC Compiler User Guide* can be useful if additional command line options are desired.
The Silicon Labs USB Debug Adapter can be used with the Silicon Labs IDE and the on-chip debug/programming circuitry of the C8051F310* for programming the MCU and debugging your code.
* PDF Link