STM32 CUBE project

59 views
Skip to first unread message

Ed Lee

unread,
May 6, 2021, 1:07:23 PMMay 6
to
So, i created the ADC1 & PIOC13 blinker, bit it does me no good without knowing what the analog values are. But when i try to create an USB_CDC device, it complaints about:

ADC1:
partly disable conflit with
USB_FS_OTG: device mode only

Does it mean i can't use USB and ADC together?

By the way, how do i tell the IDE to keep it's hand off my codes?
It keeps whipping out my codes when changing configurations.

Richard Damon

unread,
May 6, 2021, 1:46:02 PMMay 6
to
The ADC likely has a LOT of possible pins. Some of them will conflict
with other operations.

That sounds like if you want to use the ADC1 pin, you can't also use
USB_FS_OTG. If you want that function, use a different ADC pin.


To avoid it wiping out your code, don't put it in the sections of the
file marked AUTO-GENERATED, DO NOT EDIT.


Ed Lee

unread,
May 6, 2021, 2:10:39 PMMay 6
to
On Thursday, May 6, 2021 at 10:46:02 AM UTC-7, Richard Damon wrote:
> On 5/6/21 1:07 PM, Ed Lee wrote:
> > So, i created the ADC1 & PIOC13 blinker, bit it does me no good without knowing what the analog values are. But when i try to create an USB_CDC device, it complaints about:
> >
> > ADC1:
> > partly disable conflit with
> > USB_FS_OTG: device mode only
> >
> > Does it mean i can't use USB and ADC together?
> >
> > By the way, how do i tell the IDE to keep it's hand off my codes?
> > It keeps whipping out my codes when changing configurations.
> >
> The ADC likely has a LOT of possible pins. Some of them will conflict
> with other operations.
>
> That sounds like if you want to use the ADC1 pin, you can't also use
> USB_FS_OTG. If you want that function, use a different ADC pin.

I tried all PA0 to PA7, nothing work.

> To avoid it wiping out your code, don't put it in the sections of the
> file marked AUTO-GENERATED, DO NOT EDIT.

I put my codes in USER init section of main.c. Cube still whip them out. Fortunately, i have backup to put them back after final configuration.

Ed Lee

unread,
May 6, 2021, 4:20:11 PMMay 6
to
Just out of curiosity, I tried the code on F469. It allows some ADC1 pins and FS_OTG. So, there seems to be some limitations with the F411.

Ed Lee

unread,
May 6, 2021, 9:24:06 PMMay 6
to
F103 seems to work also. Only the F411 is crippled. Just ordered the F103 board, will try it in a few days.

Reinhardt Behm

unread,
May 7, 2021, 4:46:04 AMMay 7
to
On 5/7/21 2:10 AM, Ed Lee wrote:
> I put my codes in USER init section of main.c. Cube still whip them out. Fortunately, i have backup to put them back after final configuration.

You must disable the garbage collector. ;-)

--
Reinhardt

Don Y

unread,
May 7, 2021, 4:48:50 AMMay 7
to
Tee-hee-hee

Ed Lee

unread,
May 7, 2021, 9:47:23 AMMay 7
to
No, i just need to pay for a bigger garbage can. Paying 100 gallon, for my 48 gallon can.

I use TQFP 100 package to program the QFN 48 chip, to get around the constraints. Seems like a ST software bug, it should be the same chip inside.

Now i can read the analog signals, dump it to the server as USB CDC device, and blink the LED to make sure it's running. The server will be on a remote location, but the techs can watch the LED.

Well, my trash is better than ST's trash.

Dave Nadler

unread,
May 8, 2021, 8:29:02 PMMay 8
to
On 5/7/2021 9:47 AM, Ed Lee wrote:
> Now i can read the analog signals, dump it to the server as USB CDC device, and blink the LED to make sure it's running.

Are you sure? Have you debugged the ST USB stack?

> The server will be on a remote location, but the techs can watch the LED.

Cheaper to use techs than parts with competent SW?

> Well, my trash is better than ST's trash.

Only if you rewrite all the drivers...

Ed Lee

unread,
May 8, 2021, 11:36:35 PMMay 8
to
On Saturday, May 8, 2021 at 5:29:02 PM UTC-7, Dave Nadler wrote:
> On 5/7/2021 9:47 AM, Ed Lee wrote:
> > Now i can read the analog signals, dump it to the server as USB CDC device, and blink the LED to make sure it's running.
> Are you sure? Have you debugged the ST USB stack?

i am reading the external analog pins PA1 to PA7, but only if i fake it as TQFP 100 or above, not QFN48. However, they should be the same chip inside. Also, it would not allow USB and full duplex USART1, so TX only.

> > The server will be on a remote location, but the techs can watch the LED.
> Cheaper to use techs than parts with competent SW?

They just need to make sure the micro is running, and call me if it's blinking red or not blinking at all. Normally, it should be blinking green.

> > Well, my trash is better than ST's trash.
> Only if you rewrite all the drivers...

It also complaints about many conflicts when enabling I/O pins, for which I know that they are not true.
Reply all
Reply to author
Forward
0 new messages