I have STM32F103C8T6 eval board "Blue Pill". Then I took RT-STM32F103-MAPLEMINI example, change ld for this MCU and ran this example. But when I try to connect by gtkterm it gives next error: "Control signals read: Inappropriate ioctl for device". Also I have tried to connect with simple PySerial example and it gives about same message.
What else has to be implemented for being ready to receive some date over USB.
In Linux it is available with the name /dev/ttyACM0
Thank You,
STM32F103C8T6 USB CDC
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: STM32F103C8T6 USB CDC
Hi,
When porting from one board to another you need to create new "board files" or GPIO/clock settings will likely not be compatible, that can create any kind of errors.
Look at board files under /os/hal/boards.
Giovanni
When porting from one board to another you need to create new "board files" or GPIO/clock settings will likely not be compatible, that can create any kind of errors.
Look at board files under /os/hal/boards.
Giovanni
-
- Posts: 77
- Joined: Sat Mar 19, 2016 8:07 pm
- Been thanked: 17 times
Re: STM32F103C8T6 USB CDC
Tuxford wrote:I have STM32F103C8T6 eval board "Blue Pill".
I don't know if you are aware of this, but recently a lot of the boards sold as "Blue Pill" do not contain true STM32F103 from ST anymore, but MCUs that are more or less compatible from other manufacturers. Sometimes they carry their true chip marking, sometimes the marking is faked to read ST.
These MCUs often are able to run basic programs designed for the STM32F103 just fine, but once you use more advanced peripherals like DMA, there are differences that let the programs fail. This could be the issue you are seeing.
Here is some more information about this issue, photo comparison and a program designed to detect the fakes:
https://www.blaatschaap.be/tag/32f103/
https://github.com/keirf/Greaseweazle/wiki/STM32-Fakes
-
- Posts: 25
- Joined: Fri Nov 06, 2020 3:28 pm
- Location: Salivonky UA
- Has thanked: 4 times
- Been thanked: 4 times
Re: STM32F103C8T6 USB CDC
@electronic_eel
I know about it. Other case is CS32F103C8T6 instead of STM32F103C8T6. This is not my case. The problem is related to insufficient knowledge of ChibiOS.
So.. I took wrong board.c. I took minimal board config:
Device started well. Then I tried to handle data receiving.
But breakpoint doesn't hit in onDataReceived. Is there some doc how to implement data handling via USB CDC?
I know about it. Other case is CS32F103C8T6 instead of STM32F103C8T6. This is not my case. The problem is related to insufficient knowledge of ChibiOS.
So.. I took wrong board.c. I took minimal board config:
Code: Select all
#include "hal.h"
#if HAL_USE_PAL || defined(__DOXYGEN__)
const PALConfig pal_default_config = {
{VAL_GPIOAODR, VAL_GPIOACRL, VAL_GPIOACRH},
{VAL_GPIOBODR, VAL_GPIOBCRL, VAL_GPIOBCRH},
{VAL_GPIOCODR, VAL_GPIOCCRL, VAL_GPIOCCRH},
{0, 0, 0},
{0, 0, 0},
};
#endif
void __early_init(void)
{
stm32_clock_init();
}
void boardInit(void)
{}
Device started well. Then I tried to handle data receiving.
Code: Select all
static const USBEndpointConfig ep1config = {
USB_EP_MODE_TYPE_BULK,
NULL,
sduDataTransmitted,
onDataReceived,
0x0040,
0x0040,
&ep1instate,
&ep1outstate,
2,
NULL
};
But breakpoint doesn't hit in onDataReceived. Is there some doc how to implement data handling via USB CDC?
Who is online
Users browsing this forum: No registered users and 19 guests