embeded/Cortex-M3 STM2026. 1. 11. 16:03

프로젝트 생성해서 좀 가지고 놀려고 하는데, 어... ioc파일이 없다? 

 

그래서 new.. 눌러서 생성가능한걸 보니

stm32 관련해서 많이 사라진 느낌이 든다.

 

검색해보니, cubeide 2.0 되면서 cubeMX 통합이 풀린 최초의 버전이 되었다는데

[링크 : https://community.st.com/t5/stm32cubeide-mcus/cubeide-2-0-does-not-open-ioc-files/td-p/857295]

 

전반적으로 다들 분노에 찬 상황 ㅋㅋㅋ

느린(?) eclipse 사용을 감수하는 이유가 cubeMX 설치없이 cubeIDE 에서 다할수 있어서 였는데

그 장점을 포기한 분리라.. 왜 이런 쓰레기 결정이 통과된거지?

We are pleased to announce that STM32CubeIDE 2.0.0 release is available.
STM32CubeIDE is now independent from STM32CubeMX.
With this release, device configuration, previously handled within STM32CubeIDE via STM32CubeMX, is now exclusively available through the stand-alone STM32CubeMX tool.
Users will configure microcontroller peripherals and generate initialization code separately in STM32CubeMX, then import the generated projects into STM32CubeIDE for coding and debugging.  
STM32CubeIDE, is now a stand-alone tool, offers the possibility to create empty project through its own MCU/Board selectors now present inside.
What does this change mean for developers? 
  • Separate download and installation: STM32CubeMX is no more integrated in STM32CubeIDE, requiring separate download alongside STM32CubeIDE 2.0.0 for configuration and code generation. 
  • Tool update flexibility: Developers can update and freeze STM32CubeMX and STM32CubeIDE independently, with multiple versions of each installed side-by-side. 
  • Memory footprint and performance: Removing STM32CubeMX integration reduces installation size (~3.7GB to 2.9GB) and lowers CPU/RAM usage, improving stability especially on Linux and Mac. 
Other relevant updates in STM32CubeIDE 2.0.0 
  • Microcontroller, microprocessor, and board lists aligned with STM32CubeMX v6.16.0:
    • Added the support for new microcontrollers in the STM32N6 series
    • Added the support for new microcontrollers in the STM32H5 series
    • Added the support for new microcontrollers in the STM32WBA series
    • Added the support for new microcontrollers in the STM32WL3x product line
    • Added the support for new boards: NUCLEO-WL3RKB1 and NUCLEO-WL3RKB2
  • User authentication removed
  • ST-MCU-FINDER-PC removed
  • Support for ST-ARM-CLANG, STMicroelectronics LLVM-based toolchain for Arm®, through site update mechanism
  • Support for GCC 14 toolchain through site update mechanism
  • Support for semihosting feature through debug via ST-LINK GDB server
  • Support for bundled CMake/Ninja binaries
Main fixed issues in 2.0.0:
Refer to the STM32 microcontroller wiki at:
https://wiki.st.com/stm32mcu/wiki/STM32CubeIDE:STM32CubeIDE_errata_2.0.x
Known problems and limitations in 2.0.0:
Refer to the STM32 microcontroller wiki at:
https://wiki.st.com/stm32mcu/wiki/STM32CubeIDE:STM32CubeIDE_errata_2.0.x
How to get STM32CubeIDE 2.0.0:
  • Under this Link 
  • Or update your current installation of STM32CubeIDE using: Help > Check for updates (The in-tool update does not allow updating the drivers and STLINK server tool. Full installation is required for this to be done).

[링크 : https://community.st.com/t5/stm32cubeide-mcus/stm32cubeide-2-0-0-released/td-p/857110#:~:text=With%20this%20release%2C%20device%20configuration%2C%20previously%20handled%20within%C2%A0STM32CubeIDE%C2%A0via%C2%A0STM32CubeMX%2C%20is%20now%20exclusively%20available%20through%20the%20stand%2Dalone%C2%A0STM32CubeMX%C2%A0tool.]

 

현재로선 1.19로 돌아가는게 방법일듯.

Posted by 구차니
embeded/Cortex-M3 STM2026. 1. 6. 11:44

cubeide의 help에서 manage embedded software packages로 접근하거나

 

ioc 파일 열고 software packs - manage software packs로 접근하면 된다.

깔긴했는데 어떻게 띄우지 -ㅁ-?

Posted by 구차니
embeded/Cortex-M3 STM2026. 1. 5. 16:51

대~~충 프로젝트 하나 파고 외부 8MHz로 해서 PLL 사용해 USB에는 48MHz를 넣어준다.

 

USB Fast Speed 를 지원하도록 하고 CDC(VCP) 를 지원하도록 하면

 

 

PA11 / PA12에 USB_DP / USB_DM 이라고 표기된다.

그런데.. D는 D+ 니까 Positive 같은데 왜 D-는 DM이지? negative DN 이어야 하지 않나?

(ai 답변. data minus.. -_-)

 

아무튼 미들웨어 추가하면, 미들웨어와 USB_DEVICE 라는 디렉토리가 추가된다.

 

함수 쓰는건 귀찮으니 대충 끌어옴.

int main(void)
{

/* USER CODE BEGIN 1 */
#define BUF_SIZE 30
uint8_t usb_buf[BUF_SIZE];
uint32_t count = 0;
/* USER CODE END 1 */

/* MCU Configuration--------------------------------------------------------*/

/* Reset of all peripherals, Initializes the Flash interface and the Systick. */
HAL_Init();

/* USER CODE BEGIN Init */

/* USER CODE END Init */

/* Configure the system clock */
SystemClock_Config();

/* USER CODE BEGIN SysInit */

/* USER CODE END SysInit */

/* Initialize all configured peripherals */
MX_GPIO_Init();
MX_USB_DEVICE_Init();
/* USER CODE BEGIN 2 */

/* USER CODE END 2 */

/* Infinite loop */
/* USER CODE BEGIN WHILE */
while (1)
{
sprintf((char*)usb_buf, "USB CDC TEST %ld\r\n", count);
CDC_Transmit_FS(usb_buf, BUF_SIZE);
HAL_Delay(1000);
memset(usb_buf,0,BUF_SIZE);
count++;

/* USER CODE END WHILE */

/* USER CODE BEGIN 3 */
}
/* USER CODE END 3 */
}

[링크 : https://eteo.tistory.com/194]

 

꽂으니 아래처럼 인식한다.

$ sudo demsg -w
[25664.443438] usb 1-2: new full-speed USB device number 26 using xhci_hcd
[25664.574720] usb 1-2: New USB device found, idVendor=0483, idProduct=5740, bcdDevice= 2.00
[25664.574741] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[25664.574748] usb 1-2: Product: STM32 Virtual ComPort
[25664.574754] usb 1-2: Manufacturer: STMicroelectronics
[25664.579419] cdc_acm 1-2:1.0: ttyACM0: USB ACM device

 

$ lsusb -t -v
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/12p, 480M
    ID 1d6b:0002 Linux Foundation 2.0 root hub
    |__ Port 2: Dev 26, If 0, Class=Communications, Driver=cdc_acm, 12M
        ID 0483:5740 STMicroelectronics Virtual COM Port
    |__ Port 2: Dev 26, If 1, Class=CDC Data, Driver=cdc_acm, 12M
        ID 0483:5740 STMicroelectronics Virtual COM Port

minicom은 9600으로 하던 115200 으로 하던 동일하게 값이 잘 들어온다. 신기하네

다만 많은 데이터가 있을때는 어떻게 될 진 미지수. 나중에 테스트 해봐야지

 

 

1회 굽기는 되는데 그 이후로 rebooting이 안될 때

step 1. reset 누르고 connect 누르고 reset 뗀다음 full chip erase

 

step 2. cubeide에서 swd 핀 할당해주기

 

"no debug" 로 두면 PA13/PA14가 주황색으로 되는데, 그러면 계속 retry 뜨니까 Serial Wire로 변경해준다.(SWO)

이건 실패시



STMicroelectronics ST-LINK GDB server. Version 7.8.0
Copyright (c) 2024, STMicroelectronics. All rights reserved.

Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 1
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Disabled
        SWD Debug                  : Enabled

Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.17.0                  
      -------------------------------------------------------------------



Log output file:   /tmp/STM32CubeProgrammer_RFILwX.log
ST-LINK SN  : 31000D000D2D343632525544
ST-LINK FW  : V2J45S7
Board       : --
Voltage     : 3.21V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x410
Revision ID : Rev X
Device name : STM32F101/F102/F103 Medium-density
Flash size  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M3
BL Version  : --



Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_byIESj.srec
  File          : ST-LINK_GDB_server_byIESj.srec
  Size          : 31.65 KB 
  Address       : 0x08000000 


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 31]
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:01.365



Verifying ...




Download verified successfully 


Shutting down...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...
Target is not responding, retrying...

 

이건 설정해주고 잘 될 때

STMicroelectronics ST-LINK GDB server. Version 7.8.0
Copyright (c) 2024, STMicroelectronics. All rights reserved.

Starting server with the following options:
        Persistent Mode            : Disabled
        Logging Level              : 1
        Listen Port Number         : 61234
        Status Refresh Delay       : 15s
        Verbose Mode               : Disabled
        SWD Debug                  : Enabled

Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
Debugger connected
Waiting for debugger connection...
      -------------------------------------------------------------------
                        STM32CubeProgrammer v2.17.0                  
      -------------------------------------------------------------------



Log output file:   /tmp/STM32CubeProgrammer_0DypHa.log
ST-LINK SN  : 31000D000D2D343632525544
ST-LINK FW  : V2J45S7
Board       : --
Voltage     : 3.21V
SWD freq    : 4000 KHz
Connect mode: Under Reset
Reset mode  : Hardware reset
Device ID   : 0x410
Revision ID : Rev X
Device name : STM32F101/F102/F103 Medium-density
Flash size  : 128 KBytes
Device type : MCU
Device CPU  : Cortex-M3
BL Version  : --



Memory Programming ...
Opening and parsing file: ST-LINK_GDB_server_a2ozrR.srec
  File          : ST-LINK_GDB_server_a2ozrR.srec
  Size          : 31.65 KB 
  Address       : 0x08000000 


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 31]
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:01.371



Verifying ...




Download verified successfully 


Shutting down...
Exit.

[링크 : https://blog.naver.com/crucian2k3/221533654464]

 

stlink/v2 에서는 3v3 핀을 제거하고 usb를 연결해주면 깔끔하게 전원이랑 문제없이 연결된다.

 

+

2026.01.06

되긴한데.. 먼가 잘되진 않는 느낌. 소스코드 하나 붙여넣고 그러면 정상적으로 나오지 않고

usb 연결한채로 프로그램을 다시 구으면 usb 뽑았다 꽂기 전에는 재기동이 정상적으로 이루어지지 않는다.

클럭을 올려도 (72MHz) 안되는걸 보면 다른게 문제인데... 멀까?

// main.c
void USB_CDC_RxHandler(uint8_t* Buf, uint32_t Len)
{
  for(int idx = 0; idx < Len;idx++)
  if(Buf[idx] == 0x0D) Buf[idx] = 0x0A;
CDC_Transmit_FS(Buf, Len);
}

// usbd_cdc_if.c
static int8_t CDC_Receive_FS(uint8_t* Buf, uint32_t *Len)
{
  /* USER CODE BEGIN 6 */
  USBD_CDC_SetRxBuffer(&hUsbDeviceFS, &Buf[0]);
  USBD_CDC_ReceivePacket(&hUsbDeviceFS);

  USB_CDC_RxHandler(UserRxBufferFS, *Len);
  memset(UserRxBufferFS, '\0', *Len);

  return (USBD_OK);
  /* USER CODE END 6 */
}

 

[링크 : https://deepbluembedded.com/stm32-usb-cdc-virtual-com-port-vcp-examples/#stm32-usb-cdc-transmit-example]

Posted by 구차니
embeded/Cortex-M3 STM2026. 1. 5. 14:25

PA1이 high로 되어있어야 한다는데

D+가  high로 되어있어야지 usb로 인식되려나?

[링크 : https://jeonhj.tistory.com/29]

 

그래서 stm32f103c8t6 blue pill 회로도 찾아보니 d+ 라인에 5v pull up이 걸려있다.

내가 가진건 정확한 모델을 알 수 없는 클론이라 머.. 이대로 되어있을거라고 생각해도 되려나?

[링크 : https://stm32-base.org/assets/pdf/boards/original-schematic-STM32F103C8T6-Blue_Pill.pdf]

 

Full speed 에서는 D+에 1.5k 의 pull up을

Low speed 에서는 D-에 1.5k 의 pull down을 규격으로 내세우고 있다.

[링크 : https://wcours.gel.ulaval.ca/GIF1001/old/h20/docs/USB_20.pdf]

[링크 : https://www.varofla.com/8c2ccda5-dc69-47a7-bd69-dd90aa64e5b1]

'embeded > Cortex-M3 STM' 카테고리의 다른 글

stm32cubeide에 x-cube-ai 설치  (0) 2026.01.06
stm32f103c9t6(bluepill) + stlinkv2 + cdc(vcp)  (0) 2026.01.05
bluepill 보드를 stlink v2로 만들기  (0) 2025.12.16
stm32f103ret crc  (0) 2025.12.09
stm32f103ret middleware - usb  (0) 2025.12.09
Posted by 구차니
embeded/Cortex-M3 STM2025. 12. 16. 16:10

discovery 보드에서 jtag 부분에 stm32f103c8t6을 사용하고 있길래

[링크 : https://www.st.com/en/evaluation-tools/b-l072z-lrwan1.html]

 

저번에 구매했던 bluepill 보드를 어떻게 하면 jtag으로 개조할 수 있을까 하고 찾아보는데..

합법적이고 공식적인 방법은 없는듯.

[링크 : https://blog.naver.com/chandong83/222586172793]

 

[링크 : https://www.st.com/en/development-tools/stsw-link007.html] << 펌웨어 업로더

[링크 : https://www.st.com/en/development-tools/stsw-link004.html] << 펌웨어 업로더

[링크 : https://github.com/Krakenw/Stlink-Bootloaders] << 누군가 덤프해둔 stlink 펌웨어

 

This Firmware is not open source. But it may be delivered in a few cases after request to an FAE or a marketing agent.

[링크 : https://community.st.com/t5/stm32-mcus-boards-and-hardware/st-link-source-code/td-p/711010]

 

반대로.. jtag을 싸게 팔면 그걸 사서 bluepill 처럼 써버리는것도 방법이려나?

'embeded > Cortex-M3 STM' 카테고리의 다른 글

stm32f103c9t6(bluepill) + stlinkv2 + cdc(vcp)  (0) 2026.01.05
stm32f103 bluepill 회로도, usb 풀업  (1) 2026.01.05
stm32f103ret crc  (0) 2025.12.09
stm32f103ret middleware - usb  (0) 2025.12.09
stm32f103ret connectivity - usb  (0) 2025.12.09
Posted by 구차니
embeded/Cortex-M3 STM2025. 12. 9. 23:03

하드웨어로 구현된거라 소프트웨어로 루프돌리는것 보다 빠르다는게 장점인데 대충(?) 60배 빠르다고 한다.

[링크 : https://www.st.com/resource/en/application_note/an4187-using-the-crc-peripheral-on-stm32-microcontrollers-stmicroelectronics.pdf]

 

hcrc 라는 핸들이 선언되어 있고

HAL_CRC_Calcuate() 함수를 이용해서 바로 리턴을 받는 구조인 듯.

/* Private variables ---------------------------------------------------------*/
CRC_HandleTypeDef hcrc;

uint32_t HAL_CRC_Calculate(CRC_HandleTypeDef *hcrc, uint32_t pBuffer[], uint32_t BufferLength)
{
  uint32_t index;      /* CRC input data buffer index */
  uint32_t temp = 0U;  /* CRC output (read from hcrc->Instance->DR register) */

  /* Change CRC peripheral state */
  hcrc->State = HAL_CRC_STATE_BUSY;

  /* Reset CRC Calculation Unit (hcrc->Instance->INIT is
  *  written in hcrc->Instance->DR) */
  __HAL_CRC_DR_RESET(hcrc);

  /* Enter 32-bit input data to the CRC calculator */
  for (index = 0U; index < BufferLength; index++)
  {
    hcrc->Instance->DR = pBuffer[index];
  }
  temp = hcrc->Instance->DR;

  /* Change CRC peripheral state */
  hcrc->State = HAL_CRC_STATE_READY;

  /* Return the CRC computed value */
  return temp;
}

[링크 : https://cpattern.tistory.com/218]

[링크 : https://m.blog.naver.com/sheld2/222346016827] crc32 와 동일하게 나오게 하려면 수정 필요

[링크 : https://blog.naver.com/eziya76/221507312819]

 

[링크 : https://community.st.com/t5/stm32-mcus/crc-computation-in-stm32-mcus-and-post-build-creation/ta-p/49710]

 

CRC calculation unit, 96-bit unique ID

2.3.3 CRC (cyclic redundancy check) calculation unit
The CRC (cyclic redundancy check) calculation unit is used to get a CRC code from a 32-bit data word and a fixed generator polynomial.
Among other applications, CRC-based techniques are used to verify data transmission or storage integrity. In the scope of the EN/IEC 60335-1 standard, they offer a means of verifying the Flash memory integrity. The CRC calculation unit helps compute a signature of the software during runtime, to be compared with a reference signature generated at linktime and stored at a given memory location.

[링크 : https://www.st.com/resource/en/datasheet/stm32f103rc.pdf]

'embeded > Cortex-M3 STM' 카테고리의 다른 글

stm32f103 bluepill 회로도, usb 풀업  (1) 2026.01.05
bluepill 보드를 stlink v2로 만들기  (0) 2025.12.16
stm32f103ret middleware - usb  (0) 2025.12.09
stm32f103ret connectivity - usb  (0) 2025.12.09
STSW-STM32084 / usb demo  (0) 2025.12.09
Posted by 구차니
embeded/Cortex-M3 STM2025. 12. 9. 17:02

쭈욱 눌러보는데 저 FS가 Full Speed(12Mbps) 였군..

아무튼 지원가능한 클래스는 6가지이다. DFU로도 쓰면서 HID로 쓰고.. 이런식의 구성은 안될 것 같다.

 

Audio Deivce Class

 

샘플링 주파수는 250 ~ 48000 sample/s  이 가능하다. 내장  ADC를 어떻게 잘(?) 굴리면 48k 까지 가능하려나?

 

Communication Device Class (Virtual Port)

그래도 가상 com port인데 baudrate이 없네?

 

Download Firmware Update Class (DFU)

펍웨어 업로드 할때 쓰기 좋은 DFU 클래스.

USBD_DFU_MEDIA interface 는 무슨 의미이려나? Kg 써있으니 몸무게 같네

@Internal Flash   /0x08000000/03*016Ka,01*016Kg,01*064Kg,07*128Kg,04*016Kg,01*064Kg,07*128Kg

 

Human Interface Device Class (HID)

가상 키보드, 마우스, 조이스틱 만들기 좋은 HID 클래스

 

Custom Human Interface Device Class

HID랑 머가 다르려나? class parameter에 IN ENDPOINT, OUT ENDPOINT가 추가 되긴하는데..

송수신이 가능한 HID인가?

 

Mass Storage Class

microSD hat 붙이면 SD 플래시 메모리 만들수 있겠군

 

'embeded > Cortex-M3 STM' 카테고리의 다른 글

bluepill 보드를 stlink v2로 만들기  (0) 2025.12.16
stm32f103ret crc  (0) 2025.12.09
stm32f103ret connectivity - usb  (0) 2025.12.09
STSW-STM32084 / usb demo  (0) 2025.12.09
stlink v2 클론 도착!  (0) 2025.11.26
Posted by 구차니
embeded/Cortex-M3 STM2025. 12. 9. 16:45

23새 프로젝트 생성해서 이것저것 눌러보고 있는 중인데 USB는 무조건 48MHz가 들어가야 하나보다.

 

 

그 와중에 APB1 클럭은 10~36Mhz는 들어가야 하는 제약이라니

 

그 와중에  PLL source는 HSE만 허용한다고.. 왜 활성화 안되냐고!

 

먼가 꼬였었는지 RCC 설정이 없었는데 다시 ioc 파일 열고 외부 클럭 하니 이제야 된다.

USB를 쓰려면 PLL 클럭이 있어야 하고 그러려면 외부 클럭이 있어야 한다.

 

USB FS 활성화 하니 PA11 / PA12 가 설정된다.

 

Full Speed 12MB/s 만 선택지에 있고(USB FS - Full Speed)

Link Power Management를 활성화 하려면 Low Power를 Enable 해주어야 한다.

Battery Charging은 멀 하던 Enable 할 수 없네

 

NVIC Settings 제외하면 딱히 설정할 내용이 없긴한다.

 

'embeded > Cortex-M3 STM' 카테고리의 다른 글

stm32f103ret crc  (0) 2025.12.09
stm32f103ret middleware - usb  (0) 2025.12.09
STSW-STM32084 / usb demo  (0) 2025.12.09
stlink v2 클론 도착!  (0) 2025.11.26
stm32 cubeide git commit hash  (0) 2025.11.24
Posted by 구차니
embeded/Cortex-M3 STM2025. 12. 9. 16:43

 

[링크 : https://www.st.com/en/microcontrollers-microprocessors/stm32f103re.html]

 

받아보니 윈도우용.. OTL

[링크 : https://www.st.com/en/development-tools/stsw-stm32084.html#overview]

 

STM32F103RET 인데 USB Prescaler / To USB 가 있었네?

 

핀을 쓰고 있어서 활성화는 안되는데 Device (FS) 만 보인다.

File system인줄 알았는데 Fast Speed (12Mbps) 인 듯.

 

[링크 : https://blog.naver.com/eziya76/220945711310]

'embeded > Cortex-M3 STM' 카테고리의 다른 글

stm32f103ret middleware - usb  (0) 2025.12.09
stm32f103ret connectivity - usb  (0) 2025.12.09
stlink v2 클론 도착!  (0) 2025.11.26
stm32 cubeide git commit hash  (0) 2025.11.24
stm32f103c8t6 blue pill board  (0) 2025.11.22
Posted by 구차니
embeded/Cortex-M3 STM2025. 11. 26. 17:43

좀 더 써봐야 알겠지만, STM32F103C8T6과 STLink v2 클론 SWD로 작동 확인완료!

그나저나 reset은 안해놔서 리셋이 될지 모르겠네

 

'embeded > Cortex-M3 STM' 카테고리의 다른 글

stm32f103ret connectivity - usb  (0) 2025.12.09
STSW-STM32084 / usb demo  (0) 2025.12.09
stm32 cubeide git commit hash  (0) 2025.11.24
stm32f103c8t6 blue pill board  (0) 2025.11.22
stm32f103 usb c 연결 + usb ttl 연결  (0) 2025.11.22
Posted by 구차니