embeded/Cortex-M4 STM2026. 1. 5. 17:46

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

stm32g4 cordic fmac  (0) 2025.11.28
STM32CubeProgrammer / uart / parity  (0) 2025.11.28
stm32flash 0.5 0.7 버전과 stm32g473  (0) 2025.11.28
stm32g473 ADC calibration  (0) 2025.11.28
stm32f411 black fill board  (0) 2025.11.22
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]

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

stm32f103 bluepill 회로도, usb 풀업  (1) 2026.01.05
bluepill 보드를 stlink v2로 만들기  (0) 2025.12.16
stm32f103ret crc  (0) 2025.12.09
stm32f103ret middleware - usb  (0) 2025.12.09
stm32f103ret connectivity - usb  (0) 2025.12.09
Posted by 구차니

문득 생각나서 검색하는데 실험적인 기능.. smb3 멀티채널

에이 설마 저런게 옵션이겠어?goTsmsep

 

 

EXPERIMENTAL FEATURES
=====================

SMB3 Multi-Channel
------------------

Samba 4.4.0 adds *experimental* support for SMB3 Multi-Channel.
Multi-Channel is an SMB3 protocol feature that allows the client
to bind multiple transport connections into one authenticated
SMB session. This allows for increased fault tolerance and
throughput. The client chooses transport connections as reported
by the server and also chooses over which of the bound transport
connections to send traffic. I/O operations for a given file
handle can span multiple network connections this way.
An SMB multi-channel session will be valid as long as at least
one of its channels are up.

In Samba, multi-channel can be enabled by setting the new
smb.conf option "server multi channel support" to "yes".
It is disabled by default.

[링크 : https://www.samba.org/samba/history/samba-4.4.0.html]

 

진짜냐?!

4.4.0 에서 실험 기능으로 도입되고, 4.15 에서부터는 기본값으로 바뀐듯?

server multi channel support (G)
This boolean parameter controls whether smbd(8) will support SMB3 multi-channel.

This parameter was added with version 4.4.

Note that this feature was still considered experimental up to 4.14.

Due to dependencies to kernel APIs of Linux or FreeBSD, it's only possible to use this feature on Linux and FreeBSD for now. For testing this restriction can be overwritten by specifying force:server multi channel support=yes in addition.

This option is enabled by default starting with to 4.15 (on Linux and FreeBSD).

Default: server multi channel support = yes

[링크 : https://www.samba.org/samba/docs/current/man-html/smb.conf.5.html]

'프로그램 사용 > SMB(Samba)' 카테고리의 다른 글

cifs mount 실패시 설치 패키지  (0) 2023.02.10
nas samba warn  (0) 2019.03.17
smb 와 selinux 설정  (0) 2019.02.14
smb 서비스 속도향상하기(SSD-bcache, AIO)  (0) 2019.02.01
samba acpi s3 wake up  (0) 2017.08.11
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' 카테고리의 다른 글

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
stm32f103ret connectivity - usb  (0) 2025.12.09
Posted by 구차니

권력을 이용한다고 해야하나.. 그냥 폭력주의라고 해야하나..

일부에서는 베네수엘라 국민들이 환영하고 있다는 말도 있는데.. 쩝...

 

주권국가 대통령 생포한 트럼프···‘불량 초강대국의 시대’ 본격화

[링크 : https://www.khan.co.kr/article/202601041443001]

'개소리 왈왈 > 정치관련 신세한탄' 카테고리의 다른 글

영포티 단상  (0) 2025.11.10
은행 이자는 점점 떨어지네  (0) 2025.09.17
콜래트럴 데미지  (0) 2025.06.03
전장련 시위 시작  (0) 2025.04.21
보수(保守)는 보수(報酬)를 먹고 자란다  (0) 2025.04.18
Posted by 구차니

연비가 잘 나와야 18킬로 ㅜㅠ

아부지는 멀 하셨길래 21km를 찍은겨 -ㅁ-?!?

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

새해는 장보기  (0) 2026.01.01
오랫만에...? 외식!  (0) 2025.12.30
새차 세차  (0) 2025.12.27
추운 크리스마스  (0) 2025.12.25
메리 크리스마스 이브  (0) 2025.12.24
Posted by 구차니

높이 조절하면 좌우로 이동되서 몇번 옮기고

200x200 브라켓 연결한다고 몇번 뗐다 붙이고

어우.. 개고생..

 

솔찍히 고생한 것이 비해서는 그리 뿌듯함이 안 느껴진다.

이전보다 더 앞으로 튀어나와버려서 뒤로가서 게임을 해야 함

그래도 유튭보기에는 딱이네 ㅋㅋ

Posted by 구차니

fnlock

ctrl-fn

[링크 : https://quasarzone.com/bbs/qf_input/views/289148]

 

체리 키랑 fn 키가 왜 빨갛게 들어왔나 했더니 이런 이유였나.

그런데 어쩌다가 ctrl, fn 조합이 눌린거지?

[링크 : https://www.cherry.de/ko-kr/product/mx-board-3-0s/downloads]

 

그나저나 체리키 활성화 시키고 누르니까

win + r 눌러서 아래 명령을 실행하고 있네 ㅋㅋㅋ

CMD /C "IF NOT EXIST %APPDATA%/CHERRYAST/CHERRY.LNK (START HTTP://R.CHERRY.CN/1/C) ELSE START %APPDATA%/CHERRYAST/CHERRY.LNK"
Posted by 구차니
게임/doom2026. 1. 2. 00:08

이제 피지컬의 한계가 느껴진다 ㅠㅠ

더 센 무기가 필요해!!!

자꾸 bfg 탄약이 보이는거 보면 이걸 쓰라는거 같긴한데.. 어후...

 

내가 하다 접으면 얘가 50% 지분 차지하는거임

 

지금하는게 미션 9 이고

13까지 있나 보네 후.. 얼마나 더 빡세질거냐 ㅠㅠ

[링크 : https://www.youtube.com/@ff63gf/videos]

'게임 > doom' 카테고리의 다른 글

둠 이터널 - 수직 동기화 문제 -_-  (2) 2025.12.20
둠 이터널 - 추종자 기지 공략  (0) 2025.12.16
doom eternal을 위해 베데스다 가입  (0) 2025.11.23
베데스다... 사태?  (0) 2025.04.24
doom eternal 시....작?  (0) 2025.04.23
Posted by 구차니

1월 1일 되자마자

개밥 부터 우르르르 사기 시작 ㅋㅋ

'개소리 왈왈 > 육아관련 주저리' 카테고리의 다른 글

새차 첫 장거리  (0) 2026.01.03
오랫만에...? 외식!  (0) 2025.12.30
새차 세차  (0) 2025.12.27
추운 크리스마스  (0) 2025.12.25
메리 크리스마스 이브  (0) 2025.12.24
Posted by 구차니