Stm32duino environment, defines, includes?

When programming for an STM32 board, e.g. Generic STM32F103C, where does the environment come from? RCC, GPIO adresses etc.? While I can compile a simple blinky program which uses PC13 as the only define coming from the environment, I cannot use symbols like RCC, GPIOA_MODER etc.

I'm using that core as well. This sketch compiled without error (but took about 5 minutes to do so)

void setup() {
  Serial.begin( 9600 ) ;
  if ( RCC ) Serial.print("Rcc") ;

}

void loop() {
  // put your main code here, to run repeatedly:

}

with these settings

I think a lot is defined in the "variants" folder.
on my PC for the Bluepill that's in :
E:\Arduino\arduino-1.8.18\portable\packages\STMicroelectronics\hardware\stm32\2.3.0\variants\STM32F1xx\F103C8T_F103CB(T-U)

Note: I have only portable installations, as I like everything to be in one tree structure and I use 8 different versions of the IDE. So your directory structure may be different.

Which STM32 core you use? From STM32 electronics or from Rodger Clark?
Please show the link

I don't seem to have the choice of boards that you have. I have an STM32F103C8T6
of quite recent make. Bought 2 weeks ago or so.
What link do you mean? In preferences I have this as Boardmanager-URL: http://dan.drown.org/stm32duino/package_STM32duino_index.json

Oh, yes, there are 2 completely different STM32duino cores with the same name.
This is the official STmicroelectronics STM32duino core URL: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json

The Roger Clark "Dan Drown" core is no longer supported by anyone.

OK, I installed the other package. Can I choose STMCubeProgrammer (DFU) as upload method?

How can I tell that the STM103C8T6 possible has 128K of Ram? (or is that flash?)

With some STM32 series chips you can using the factory built-in bootloader. However, this does not apply to the one you are using (STM32F103C8T6). This may help: Upload methods · stm32duino/wiki Wiki · GitHub . I personally use the SWD method with a cheap ST-Link V2 programmer.
Try with 128KB flash. I think you get a clear warning if there is a mismatch.

Why it doesnot apply??
stm32f103 has built-in DFU bootloader too.
I used DFU for uploading firmware to F103C8 and F103C6 very well.

It is flash. Size of the RAM is not affected by this options and it is 20k for all C8 boards

OK. Then I made an error. You can do that with the factory installed bootloader and using a USB cable ?

Sure, I used DFU with standard USB, but I am not quite sure ether the bootloader was factory installed or I did updated it myself.
I will unpack the new bluepill board to check the DFU and share the results tomorrow

I just tested it, as promised.
I open new packed bluepill and try to upload the code with DFU-upload option in Arduino-IDE.
Unfortunately, it didn't work that way

This means. that there is no built-in bootloader in bluepil and you need to download it in the board first. I did this before, but from some point it began to seem to me that this was not necessary :slight_smile:

Installing bootloader procedure is described here.

I use DFU-upload all the time. For bluepil this is my main loading method, unlike blackpil (STM32F401/411 boards) where I use st-link

One of the reasons I now use the ST-link V2 is (a) that it is dirt cheap and (b) that my experience with the Bluepill started with the Roger core and there I followed all sorts of instructions and procedures such as registering at various sites and download bits and pieces of software until I had completely lost the overview of what I had done. It did work, even directly over USB as far as I remember, that is until Roger Clark abandoned the whole thing. When the STmicroelectronics core came a long, I had a big clean up and focussed on the SWD / ST-Link upload method which is also used by many of the STmicroelectronics boards (Nucleo etc.). That just works without finding special bootloaders and fiddling around with jumpers etc. The only thing that has not changed is the persistent spam mail I get from STmicroelectronics as a result of the mandatory registration at their site.

How recognizable. Have a bag of Bluepills lying around from all sorts of fakes to a few DIY genuine STM ones. I don't use them often, so I can never remember what bootloader I put on them last time. So in the end I settled on ST-Link V2 so I never have to solve the bootloader puzzle.

I am still using Roger core for blue- and blackpills boards... I just can’t force myself to switch to a new kernel from STM.

5 posts were merged into an existing topic: STM32Cubeprogrammer doesn't find STM32F103C8T6 blue pill board

3 posts were merged into an existing topic: STM32Cubeprogrammer doesn't find STM32F103C8T6 blue pill board

Hi all. Please restrict the discussion in this topic exclusively to the original subject matter:

That can include the differences between the Roger Clark STM32 boards platform and the STM32duino boards platform.

For @krischu's problems uploading to the board, please use the other dedicated topic:

For the Roger Clarke/dan.drown.org core, you can find the chip-level definitions in .../hardware/STM32F1/2022.9.26/system/libmaple/stm32f1/include/series/*.h

In a tragic comedy of Shakespearian proportions, these are NOT the ST-provided defintions, nor are they directly compatible with ST definitions :frowning:
(Some discussion here: Is STM32 worth it? - #8 by westfw )