Error when runing USB_OTG_FS with RTOS for pendrive application - stm32

First of all I have run the project with STM32H745I + USB_OTG_FS + FATFS + MSHC for the pendrive application and it runs without any error, I am able to create a file, directrory & write into the file.
But when I add FreeRTOS in the same combination of existing project I can only mount the USB after that I stuck in HardFault handler. I don't know what the exact setting I have to do with FreeRTOS.
If anyone have idea please help me out.
Thanks!
Now, I want to run the pendrive in MSC mode with RTOS

First you need to find the location of the error. But the error may be returned because you are using the SysTick timebase. Try change it in the configuration menu to TIM1

Related

Debugging MBED with Eclipse

I am currently using mac OS to set up a debugger to debug Mbed OS application , I followed the instruction from https://os.mbed.com/docs/mbed-os/v5.12/tutorials/eclipse.html .
I successfully set up the local debug toolchain and I am stuck at this error for quite awhile already. I install "make" as written in the documentary using homebrew and also set the path as suggested but still getting this error
00:13:27 **** Incremental Build of configuration Default for project mbed-os-example-blinky ****
make all
Cannot run program “make”: Unknown reason
Error: Program “make” not found in PATH
PATH=[/Users/roseyv/Developer/gcc-arm-none-eabi-6-2017-q2-update/bin/arm-none-eabi-g++]
00:13:27 Build Failed. 1 errors, 0 warnings. (took 4ms)
Any idea how to resolve this issue? or if there is any other better way we can set up debugger to debug MBED os application
Your help will be greatly appreciated, Thank you in advance!
In the mean time Mbed has updated their website. The link you posted is no longer valid. My suggestion now would be to use Mbed Studio.
Unfortunately Mbed is moving away from supporting Eclipse and only supports IDE's for which you have to be logged in with your account, Mbed Studio or the online compiler.
You could build from the command line option. Next use something like a Segger j-link and Segger Ozone to debug. I found Ozone easier to setup with random code compared to embedded debugging on Eclipse. This is what you pay for.

Twincat Activate Configuration error 0x1028 - unable to activate

I am a beginner in Twincat and is trying to run a sample program on my system(not on target).
I did all the steps mentioned here and did get the system up and running my sample code once. However, when I tried to run it again after a system restart, I get an error message.
I tried creating a new empty solution and another one with test code, both of them throws the same error code. Also, when I click on the green Restart TwinCat system button, I get the following error.
How do I solve this?
You need to enable AMD-V in your BIOS.
The procedure is explained here:
https://youtu.be/P9uUgT8EhUM?t=1029
(This is done for an Intel system, while you seem to have an AMD system, but it's the same procedure).
Also make sure to run this file in CMD (as Administrator):
C:\TwinCAT\3.1\System\win8settick.bat
And then reboot your computer.
If this doesn't do the trick, then do core isolation and run your TwinCAT task on an isolated core. Maybe that was what you were doing before but not now? It's described quite well in this video: https://youtube.com/watch?v=q7iRvDuAOFQ

STM32F103C8T6 board not flashing with Keil 5

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.

why I got the right message from the usart of stm32 when debugged by Keil MDK , but got a wrong out put from USART when using eclipse+CDT

I install these Plug-in in eclipse to build the stm32 develop environment:
GNU ARM Eclipse Plug-in
CDT GNU Cross Development Tools
Sourcery CodeBench Lite 2014.05-28 for ARM EABI
J-Link ARM V4.15e
I am trying to run a USART1 program in eclipse and check the output of the USART1,but when I debug this code,I got the wrong output message. The message I send is "DECA0130",but what I got is "???????",this is obviously a garbled.
At first, I think the problem is I didn't write a write code .I checked my project again.But didn't find any error.
Then I build a new project in Keil Mdk use the same code.This time I got the right message from USATR1.I receive the string "DECA0130".
It's very strange. Because I'm not familiar with eclipse environment,I used Keil do my coding before.But the recent projects have forced me to write code .I think maybe somewhere I forgot to configure.
Because it's a new user,I don't know how to insert the program。If there is any need, please tell me.I will try my best to let you see
Thanks in advance
Seems to be a clock issue. Check the clock settings. The eclipse ARM plugin generates some configs for that. Check the function SetSysClock in the system/src/cmsis/system_stm32*.c file. I think the Keil MDK does this too, but with differnt config.
Edit: The function SetSysClock i mentioned is wrong. The clock config is done in the configure_system_clock function (file _initialize_hardware.c).

Debugging embedded system with Eclipse - HOW TO PRINT TO A LOGGING FILE?

I'm currently working on a project on STM32F4 and I'm using Eclipse. I've got some problems with the program - it seems to have a random behavior - sometimes it works fine, other times it has some errors. Sometimes when I try do debug with breakpoints I get the beautiful HardFault Handler and it really messes with my brains.
Sorry for the little off-topic paragraph, just wanted to let you know why I decided to use printing to a log file at some key moments in the program so I can see in which states and in which functions does the problem occur. I'm debugging through a JTAG interface with Eclipse (gdb) and I need to know if there is an easy method integrated in Eclipse that may help me use fprintf-like functions inside my program to write to a file on the disk.
If no, any other solutions?
Thanks
I do not like to connect the debug output log to the Jtag communication port because the log will not be available after development.
I usually build an SystemLog library that can send the log messages through any medium that is available (UART, USB, Ethernet or SDCARD). That's what I'd recommend you to do. It will help you through the development, and the support team on the event of any failure on field.
If stdlib is available in your project you should use the snprintf family functions to build your SystemLog.
Also, you can integrate the log output to the eclipse console by calling a serial console communicator (if you use UART) on you makefile, in this case, your makefile will have to flash the target as well.