STM32F103C8T6 board not flashing with Keil 5 - stm32

I have the following problem. Once i generate Keil project using ST CubeMX and write project into STM32F103C8 MCU, everything goes well; However, after this first flashing i'am not able to flash it anymore as it throws the following error:
Error: Flash Download failed - Target DLL has been cancelled
I have pulled Boot0 pin, activated it, and erased MCU. This procedure helps only for one time flashing; however, if i flash MCU with bare metal or CMSIS code (which was not generated by CubeMX) it works fine and i can flash as many times as i want without errors.
Could you please advice, what could be wrong and how can i fix this?

Problem was in default configuration of STM CubeMx. In System core -> Sys Debug was switched off by default. After i changed it to Serial Wire it worked.

Related

Raspberry pi pico w unable to import dht module

I was using a dht22 sensor in my raspberry pi pico w board but suddenly I can't anymore
I get the following error when trying to import dht module:
ValueError: incompatible .mpy file
I tried updating the micropython firmware to the latest version but the problem persists.
My DHT22 module is a bit faulty since I connected it backwards the first time, but it was working ok, sometimes it emits a high pitched noise, but after reconnecting it it worked normally, now It emits the sound constantly.
However the error appears regardless of the sensor being connected or not, just by calling "import dht" without any extra code.
The rest of the functions of the board are still working, I can blink the led, drive a relay module, run a web server, all the other functions of my application work normally.
After looking at the files loaded in my board an extra file was present:
dht.mpy
The file had contents from my log function (a function I use to write exceptions to a file)
I have no clue how this happened, but deleting it solved the problem

STM32CubeIDE - No STLink Detected

I am working with a Nucleo Board (Nucleo F401RE) and I have a problem with "STM32CubeIDE 1.9.0".
When I try to flash the code using the IDE debuggar I get an error message:
enter image description here
At this point I tried to connect using the "cube programmer" through which I can connect correctly and flash the code.
I am also attaching my debug settings where, as you can see, I can see the serial of my STLINK correctly.
enter image description here
I also tried to uninstall all of them, including drivers, and the problem did not go away, what could be the problem?

Issue running BLE sniffer on ESP32 complied with platform IO

here is the problem I'm searching for help for: I've created an example program for testing BLE advertisement using exactly the source found in:
https://github.com/nkolban/esp32-snippets/blob/master/cpp_utils/tests/BLETests/SampleServer.cpp
with a tiny addition of prints to make program progress visual.
When running the single file in Arduino it works perfectly as expected.
However, building it with vscode & platformio with the right setup, the program waits forever.
The right setup means correct board & Arduino platform selections which work perfectly for me for lots of other functionalities (BLE, WiFi, etc).
Following is the line where the program is waiting forever:
Thank you.
The code to run when compiled with VScode PlatfromIO

Uploaded code not executing on the Nucleo H745ZI

This is a question for people familiar with the Nucleo H745ZI, or H7 in common.
When I received the Nucleo H745ZI it had the blinking LED program on it. This was working fine.
Now I'm trying to upload my own program and it's not doing anything at all. Both the LEDs and UART aren't giving output. This is after generating a fresh project in CubeMXIDE. Everything default.
My code;
HAL_GPIO_TogglePin (GPIOB, GPIO_PIN_14);
HAL_Delay(50);
HAL_GPIO_TogglePin (GPIOE, GPIO_PIN_1);
HAL_Delay(100);
HAL_GPIO_TogglePin (GPIOB, GPIO_PIN_0);
HAL_Delay(200);
uint8_t buff[4] = {3, 4, 5, 6};
HAL_UART_Transmit(&huart3, buff, sizeof(buff), HAL_MAX_DELAY);
I've tried both building and manually uploading the CM7.bin file and using the debug tool in the CubeMXIDE. Both not working.
Firmware has been updated.
By the way, does anyone know where I can find this default program?
Found solution for NUCLEO-H745ZI-Q:
Do not drag and drop CM4 or CM7 bin file in Nucleo board storage. Use STM32CubeIDE to upload program to each one. Use default NUCLEO-H745ZI-Q board settings when creating new projects. You only need to connect ST Link USB.
When we are working on NUCLEO-H745ZI-Q remember that we have a dual core architecture so we must configure the peripherals for each core in the CubeMX project or in the Cube IDE configuration window on the tab of System Core > GPIO for the LEDS and the same for UART
Once you have generate the code, then you'll core M4 and M7 subproject directory whit their own source and main.c files.
Also, on my experience, I have notice that you must compile and upload both core-main.c-program to run your code on board, specially when you program at core M4 because the code uploaded does not execute until you upload M7 program.

Debugging STMF4 Discovery in Eclipse using GDB

Hello all: I have never posted on Stackoverflow, but I have always come here for help for years.
I have a question and problem regarding debugging in eclipse using an STLINK STM32 Discovery board. I have looked online for the answer and have followed many tutorials, but I still cannot seem to get it to work correctly. I will try my luck at asking here.
I have set up the eclipse environment correctly with my compiler and gdb server (to my knowledge). First I make sure the server is started before I press debug in eclipse. I am using Atollic STLINK gdb server. I have tried many arm-none-eabi-gdb type exe's while debugging, but they all seem the same. My debug configuration is setup to use arm-none-eabi-gdb on port 61234 (Attolic). When I press debug, the program launches correctly and goes into the debug view in eclipse. The program downloads correctly to my discovery board. I know this because I have gotten debugging to work partially and have stepped through the code without crashing on 'some' occasions depending on the compiled code and debug configuration startup options. The code is a simple LED turn on on the board. If I unplug the usb cable and plug it back in, my code runs fine, because the LEDs light up, so we know the environment is probably set up correctly, because the code downloads to flash via eclipse commands.
The problem is with actual debug steps. 99% of the time the arm-none-eabi-gdb.exe program crashes when in the debug view after I do a few "step into's" with the debugger commands at the top of eclipse. After the first line of my main function is reached, I will try to step into the first line and I get a windows crash of the arm-eabi.exe program. The debug console in eclipse reads a gdb error: .......dwarf2: C10xx Internal Error - unknown CFA rule. Now... depending on how I set the options in the debug configuration with regards to the startup tab, different options produce different results and the following options have been toggled: Halt, resume, break point at : main, etc.. This crash also seems to be dependent on the code being compiled in the main function.
Now, does this have any dependency on which compiler is used with the gdb server and arm-none-eabi-gdb.exe programs? For instance, if I compiled the code with Atollic versus Keil versus code sourcery versus IAR, would the Attollic gdb service + arm-none-eabi-gdb programs be able to work with any compiled code? Are there some missing symbols somewhere not being generated? For reference, I am using an EVAL version of the IAR compiler tool set. If I make a project with the same code in embedded workbench using the STLINK, the code compiles and debugs fine.
What is a CFA rule? Call frame address? Am I not setting up the stack pointer or something in my program? I thought the IAR compiler took care of all that junk in the cstartup.
Any help is appreciated.
Thanks,
LostTime77