'embeded'에 해당되는 글 1485건

  1. 2025.07.21 HAL_FLASH_Program
  2. 2025.07.21 stm32cubeide build analyzer
  3. 2025.07.17 열전대 써모커플러
  4. 2025.07.15 buzzer - 액티브 패시브
  5. 2025.07.08 risc-v sbc
  6. 2025.07.08 esp32 계열 정리
  7. 2025.06.30 stm32 wwdg, iwdg 차이
  8. 2025.06.27 stm32f wwdg iwdg 그리고 stop mode
  9. 2025.06.27 pynq 와 arty
  10. 2025.06.27 zynq vitis openCL
embeded/Cortex-M3 STM2025. 7. 21. 16:40

특이한 건 블럭단위가 아니라는 것과 program은 있어도 Erase나 Read 함수가 안보인다는 점.

// stm32f1xx_hal_flash.h
HAL_StatusTypeDef HAL_FLASH_Program(uint32_t TypeProgram, uint32_t Address, uint64_t Data);
HAL_StatusTypeDef HAL_FLASH_Program_IT(uint32_t TypeProgram, uint32_t Address, uint64_t Data);

HAL_StatusTypeDef HAL_FLASH_Unlock(void);
HAL_StatusTypeDef HAL_FLASH_Lock(void);
HAL_StatusTypeDef HAL_FLASH_OB_Unlock(void);
HAL_StatusTypeDef HAL_FLASH_OB_Lock(void);

// stm32f1xx_hal_flash_ex.h
HAL_StatusTypeDef  HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError);
HAL_StatusTypeDef  HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit);

HAL_StatusTypeDef  HAL_FLASHEx_OBErase(void);
HAL_StatusTypeDef  HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit);
void               HAL_FLASHEx_OBGetConfig(FLASH_OBProgramInitTypeDef *pOBInit);
uint32_t           HAL_FLASHEx_OBGetUserData(uint32_t DATAAdress);

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

[링크 : https://selpman.tistory.com/287]

 

음.. 플래시 영역은 0x0800 0000 으로 지정되어 있으니 거기서 부터 512KB (= 0x0008 0000)

인 0x0807 FFFF 까지 읽어보면 되려나

 

 

STM32F103RET 니까 아래 조건이려나

/* High Density */
#if (defined(STM32F100xE) || defined(STM32F101xE) || defined(STM32F103xE))
#define IS_FLASH_PROGRAM_ADDRESS(ADDRESS) (((ADDRESS) >= FLASH_BASE) && (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x200U) ? \
                                           ((ADDRESS) <= FLASH_BANK1_END) :  (((*((uint16_t *)FLASH_SIZE_DATA_REGISTER)) == 0x180U) ? \
                                           ((ADDRESS) <= 0x0805FFFFU) :  ((ADDRESS) <= 0x0803FFFFU))))

#endif /* STM32F100xE || STM32F101xE || STM32F103xE */

 

그런데 STM32CubeProgrammer로 확인해보니

512KB 맞고 sector는 0에서 255까지 256개 * 2KB

 

Write Protect는 0에서 31 까지 총 32개.. 8개 섹터당 1개의 write protect 인가

 

 



 

 

2.4.2 Write protection
In high-density and connectivity line devices, from page 0 to page 61, write protection is implemented with a granularity of two pages at a time. The remaining memory block (from page 62 to page 255 in high-density devices, and from page 62 to page 127 in connectivity line devices) is write-protected at once.

0~61 까지는 2개씩 해서 총 31개 write protect로 상세하게 제어되고

62~255까지 퉁쳐서 1개,

합계 32개의 write protect로 제어된다.

[링크 : https://www.st.com/resource/en/programming_manual/pm0075-stm32f10xxx-flash-memory-microcontrollers-stmicroelectronics.pdf]

 

Depending on the selected boot mode, main Flash memory, system memory or SRAM is accessible as follows:
 Boot from main Flash memory: the main Flash memory is aliased in the boot memory space (0x0000 0000), but still accessible from its original memory space (0x800 0000). In other words, the Flash memory contents can be accessed starting from address 0x0000 0000 or 0x800 0000.
 Boot from system memory: the system memory is aliased in the boot memory space (0x0000 0000), but still accessible from its original memory space (0x1FFF B000 in connectivity line devices, 0x1FFF F000 in other devices).
 Boot from the embedded SRAM: SRAM is accessible only at address 0x2000 0000.

Embedded boot loader
The embedded boot loader is located in the System memory, programmed by ST during production. It is used to reprogram the Flash memory with one of the available serial interfaces:
 In low-, medium- and high-density devices the bootoader is activated through the USART1 interface.
 In XL-density devices the boot loader is activated through the following interfaces: USART1 or USART2 (remapped).
 In connectivity line devices the boot loader can be activated through one of the following interfaces: USART1, USART2 (remapped), CAN2 (remapped) or USB OTG FS in Device mode (DFU: device firmware upgrade).

[링크 : https://www.st.com/resource/en/reference_manual/rm0008-stm32f101xx-stm32f102xx-stm32f103xx-stm32f105xx-and-stm32f107xx-advanced-armbased-32bit-mcus-stmicroelectronics.pdf]

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

stm32 eeprom emulation  (0) 2025.07.29
stm32f103ret flash program / erase 테스트  (0) 2025.07.28
stm32cubeide build analyzer  (0) 2025.07.21
stm32 wwdg, iwdg 차이  (0) 2025.06.30
stm32f wwdg iwdg 그리고 stop mode  (0) 2025.06.27
Posted by 구차니
embeded/Cortex-M3 STM2025. 7. 21. 15:35

크게 도움이 되는 기능은 아니지만 왜 안나오나 해서 찾아보니

windows - preference - STM32Cube - Build views settings 에서

on request 에서 auto로 바꾸어 주면 된다.

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

 

정책변경인진 모르겠지만 위 글을 참고하면 1.15.x~ 이후는 auto가 아니게 된 듯.

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

stm32f103ret flash program / erase 테스트  (0) 2025.07.28
HAL_FLASH_Program  (0) 2025.07.21
stm32 wwdg, iwdg 차이  (0) 2025.06.30
stm32f wwdg iwdg 그리고 stop mode  (0) 2025.06.27
stm32 cubeide ioc gen  (0) 2025.06.18
Posted by 구차니
embeded/전자회로2025. 7. 17. 11:06

웨비나 보다가 검색

보상도선을 쓰지 않으면 일반전선과 온도센서 접합점이 온도센서가 되어 오차가 발생 한다고

[링크 : https://m.blog.naver.com/jsrhim516/223414081150]

[ 링크 : https://setoo0922.tistory.com/353] 종류, 어댑터

 

열전대 용접기

[링크 : https://www.dhtc.co.kr/yc/shop/product.php?it_id=1568167478]

 

 

'embeded > 전자회로' 카테고리의 다른 글

아 어쩐지 부품이 두개더라 -_-?  (0) 2025.10.08
1.8인치 TFT SPI 128x160  (0) 2025.10.07
buzzer - 액티브 패시브  (0) 2025.07.15
rheostat ?  (0) 2024.07.25
notch filter  (0) 2024.05.21
Posted by 구차니
embeded/전자회로2025. 7. 15. 16:46

indicator 혹은 active buzzer는 내부에 회로가 내장되어

전기만 공급되면 resonant frequency 로 소리를 발생시키는 부품이다.

transducer 라던가 passive buzzer가 pwm에 의해 주파수로 입력하면 원하는 소리가 나는 부품인듯.

 

[링크 : https://puiaudio.com/file/specs-AI-1223-TWT-3V-2-R.pdf]

'embeded > 전자회로' 카테고리의 다른 글

1.8인치 TFT SPI 128x160  (0) 2025.10.07
열전대 써모커플러  (0) 2025.07.17
rheostat ?  (0) 2024.07.25
notch filter  (0) 2024.05.21
멀티미터 TR 테스트  (0) 2023.11.02
Posted by 구차니
embeded/risc-v2025. 7. 8. 11:56

'embeded > risc-v' 카테고리의 다른 글

risc-v sv39  (0) 2023.11.18
milk-v duo(risc-v)  (0) 2023.11.18
부품 도착! + 주문 취소!  (0) 2023.11.02
오늘의 지름  (0) 2023.11.01
risc-v 저가보드 / sipeed maix amigo  (0) 2023.11.01
Posted by 구차니
embeded/esp322025. 7. 8. 11:07

ESP32 / ESP32-S 만 xtensa 계열이고, 나머지는 RISC-V 계열이다.

특이하게 C5/C6/C61 에서는 802.11ax 까지 지원하고, C5만 802.11ac를 지원한다.

 

  ESP32-P4 ESP32-S3 ESP32-S2 ESP32-C5 ESP32-C6 ESP32-C61 ESP32-C3 ESP32-C2 ESP32-H4 ESP32-H2 ESP32
wifi   bgn bgn bgn/ac/ax bgn/ax bgn/ax bgn bgn     bgn
BLE   5.0   5.3 5.3 5.0 5.0 5.0 5.4 5.0 4.2/classic
arch RISC-V Xtensa Xtensa RISC-V RISC-V RISC-V RISC-V RISC-V RISC-V RISC-V Xtensa
core dual dual single single single single single single Dual Single Single/Dual
clock(MHZ) 400 240 240 240 160 160 160 120 96 96 240

[링크 https://products.espressif.com/static/Espressif%20SoC%20Product%20Portfolio.pdf]

'embeded > esp32' 카테고리의 다른 글

esp32 benchmark  (0) 2025.11.18
esp32 lvgl  (0) 2025.11.15
esp32devkitc v4  (0) 2025.01.06
esp32cam sdio wifi  (0) 2024.09.11
esp32 wifi/bt on linux  (0) 2024.08.13
Posted by 구차니
embeded/Cortex-M3 STM2025. 6. 30. 11:17

iwdg는 내부 rc 클럭으로 작동을 하는 부분으로 stop이나 standby 모드에서도 작동한다.

즉, 절전모드 하려면 iwdg는 조금은 더 주의 깊게 설정해야 한다는 의미인데...

 

wwdg 는 window 라서 특정 시간대에만 와치독을 리셋할 수 있게 한다.

너무 빠르게 리셋해도 전체 시스템이 리셋되고, 너무 늦어도 리셋된다.

작동 시간이 일정하다면 wwdg를 쓰면 될 것 같기한데...

 

Independent watchdog
The independent watchdog is based on a 12-bit downcounter and 8-bit prescaler. It is clocked from an independent 40 kHz internal RC and as it operates independently of the main clock, it can operate in Stop and Standby modes. It can be used either as a watchdog to reset the device when a problem occurs, or as a free-running timer for application timeout management. It is hardware- or software-configurable through the option bytes. The counter can be frozen in debug mode.

Window watchdog
The window watchdog is based on a 7-bit downcounter that can be set as free-running. It can be used as a watchdog to reset the device when a problem occurs. It is clocked from the main clock. It has an early warning interrupt capability and the counter can be frozen in debug mode.

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

 

 

 

[링크 : https://pineenergy.tistory.com/138]

[링크 : https://electronics.stackexchange.com/questions/123080/independent-watchdog-iwdg-or-window-watchdog-wwdg]

[링크 : https://community.st.com/t5/stm32-mcus-products/iwdg-vs-wwdg/td-p/451732]

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

HAL_FLASH_Program  (0) 2025.07.21
stm32cubeide build analyzer  (0) 2025.07.21
stm32f wwdg iwdg 그리고 stop mode  (0) 2025.06.27
stm32 cubeide ioc gen  (0) 2025.06.18
stm32 uart tx dma  (0) 2025.06.18
Posted by 구차니
embeded/Cortex-M3 STM2025. 6. 27. 17:27

iwdg가 wdg_sw 설정되는줄 알았는데.. iwdg가 software랑 hardware로 나눠지는 듯.. 찾아봐야겠네

 

Option Byte는 아래의 api를 통해 접근할수 있고

HAL_StatusTypeDef HAL_FLASHEx_OBProgram(FLASH_OBProgramInitTypeDef *pOBInit)

 

UserConfig 변수내에 bit 단위로 설정되도록 되어있다.

typedef struct
{
uint32_t OptionType; /*!< OptionType: Option byte to be configured.
This parameter can be a value of @ref FLASHEx_OB_Type */

uint32_t WRPState; /*!< WRPState: Write protection activation or deactivation.
This parameter can be a value of @ref FLASHEx_OB_WRP_State */

uint32_t WRPPage; /*!< WRPPage: specifies the page(s) to be write protected
This parameter can be a value of @ref FLASHEx_OB_Write_Protection */

uint32_t Banks; /*!< Select banks for WRP activation/deactivation of all sectors.
This parameter must be a value of @ref FLASHEx_Banks */
 
uint8_t RDPLevel; /*!< RDPLevel: Set the read protection level..
This parameter can be a value of @ref FLASHEx_OB_Read_Protection */

#if defined(FLASH_BANK2_END)
uint8_t USERConfig; /*!< USERConfig: Program the FLASH User Option Byte:
IWDG / STOP / STDBY / BOOT1
This parameter can be a combination of @ref FLASHEx_OB_IWatchdog, @ref FLASHEx_OB_nRST_STOP,
@ref FLASHEx_OB_nRST_STDBY, @ref FLASHEx_OB_BOOT1 */
#else
uint8_t USERConfig; /*!< USERConfig: Program the FLASH User Option Byte:
IWDG / STOP / STDBY
This parameter can be a combination of @ref FLASHEx_OB_IWatchdog, @ref FLASHEx_OB_nRST_STOP,
@ref FLASHEx_OB_nRST_STDBY */
#endif /* FLASH_BANK2_END */

uint32_t DATAAddress; /*!< DATAAddress: Address of the option byte DATA to be programmed
This parameter can be a value of @ref FLASHEx_OB_Data_Address */
 
uint8_t DATAData; /*!< DATAData: Data to be stored in the option byte DATA
This parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFF */
} FLASH_OBProgramInitTypeDef;

 

STOP 모드 들어가면 리셋걸리지 않게 하려면 해당 OB로 설정해주어야 하나..

/** @defgroup FLASHEx_OB_IWatchdog Option Byte IWatchdog
* @{
*/
#define OB_IWDG_SW ((uint16_t)0x0001) /*!< Software IWDG selected */
#define OB_IWDG_HW ((uint16_t)0x0000) /*!< Hardware IWDG selected */
/**
* @}
*/

/** @defgroup FLASHEx_OB_nRST_STOP Option Byte nRST STOP
* @{
*/
#define OB_STOP_NO_RST ((uint16_t)0x0002) /*!< No reset generated when entering in STOP */
#define OB_STOP_RST ((uint16_t)0x0000) /*!< Reset generated when entering in STOP */
/**
* @}
*/

/** @defgroup FLASHEx_OB_nRST_STDBY Option Byte nRST STDBY
* @{
*/
#define OB_STDBY_NO_RST ((uint16_t)0x0004) /*!< No reset generated when entering in STANDBY */
#define OB_STDBY_RST ((uint16_t)0x0000) /*!< Reset generated when entering in STANDBY */

 

HAL_FLASHEx_OBGetConfig()
HAL_FLASH_OB_Unlock()
HAL_FLASH_Unlock()
HAL_FLASH_OB_Launch()

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

[링크 : https://community.st.com/t5/stm32-mcus/how-to-program-stm32-option-bytes-with-the-hal-api/ta-p/49660]

 

IWDG는 option byte에 설정 가능 - 설정하면 리부팅 필요 혹은 강제로 리부팅됨

[링크 : https://m.blog.naver.com/kim1417/221461254045]

[링크 : https://pineenergy.tistory.com/138]

 

The Independent watchdog can not be stopped in any processor mode. You have to wake up regularly to reload the watchdog. What you can do is change the prescaler to maximum so the watchdog is counting slowly.
IWDG will only be stopped if you disconnect the controller from the power supply.

[링크 : https://stackoverflow.com/questions/53334571/disabling-stm32-hal-iwdg-or-wwdg-watchdog-before-stop-mode]

 

stm32g 의 경우인데 f에 없는 플래그가 존재한다.

[링크 : https://community.st.com/t5/stm32-mcus-products/iwdg-disable-during-sleep-stop/td-p/95106]

 

+

2025.07.31

stm32f1xx_hal.h 에서 찾은 건데..

FREEZE 로 된걸 해주면 stp 모드에서 동결되려나? 그런데 debug mode 래서 언제 쓸수 있는지 찾아봐야 할 듯.

/**
* @brief WWDG Peripherals Debug mode
*/
#define __HAL_DBGMCU_FREEZE_WWDG() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_WWDG_STOP)
#define __HAL_DBGMCU_UNFREEZE_WWDG() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_WWDG_STOP)

/**
* @brief IWDG Peripherals Debug mode
*/
#define __HAL_DBGMCU_FREEZE_IWDG() SET_BIT(DBGMCU->CR, DBGMCU_CR_DBG_IWDG_STOP)
#define __HAL_DBGMCU_UNFREEZE_IWDG() CLEAR_BIT(DBGMCU->CR, DBGMCU_CR_DBG_IWDG_STOP)

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

stm32cubeide build analyzer  (0) 2025.07.21
stm32 wwdg, iwdg 차이  (0) 2025.06.30
stm32 cubeide ioc gen  (0) 2025.06.18
stm32 uart tx dma  (0) 2025.06.18
stm32 pwm 주파수 계산  (0) 2025.06.05
Posted by 구차니
embeded/FPGA - XILINX2025. 6. 27. 16:16

pynq가 더 싸게 팔리는데 차이가 없다면 pynq를 사서 arty 이미지를 써서 가지고 노는것도 방법일 듯?

 

Between PYNQ Z1 and Arty Z7, the only difference is that the PYNQ has a microphone and Arty Z7 doesn't, otherwise they are identical from the specs point of view.

[링크 : https://forum.digilent.com/topic/20727-what-zynq-7020-board-would-you-recommend-zybo-arty-z7-pynq-z1/]

[링크 : https://www.reddit.com/r/FPGA/comments/fkumbh/is_the_arty_a7_or_a_similarly_priced_zynq_board/]

 

 

arty z7의 경우

HDMI in / out이 있는게 장점 인듯.

[링크 : https://digilent.com/reference/learn/programmable-logic/tutorials/arty-z7-hdmi-in-demo?srsltid=AfmBOop1w1FTtQP9bF_ssIaZuOXVLJhOrn1Kda292FBD_9-p5f0ogsbE]

'embeded > FPGA - XILINX' 카테고리의 다른 글

zynq vitis openCL  (0) 2025.06.27
EBAZ4205 zynq  (0) 2025.03.25
xilinx vdma  (0) 2025.01.16
ftdi jtag  (0) 2023.07.22
xilinx zynq jtag  (2) 2023.07.21
Posted by 구차니
embeded/FPGA - XILINX2025. 6. 27. 16:06

대충(?) 보기에는

openCL로 작성한 kernel을 vivado hls 에서 읽어들여

하드웨어로 synthesis 하고 그걸 메모리에 연결해서(AXI) 그냥 제어해버리는 컨셉인 듯

 

그렇게 생겨난 IP를 회로로 구성해서 zynq에 넣어서 작동하면 끝

[링크 : https://svenssonjoel.github.io/pages/zynq_hls_opencl/index.html]

'embeded > FPGA - XILINX' 카테고리의 다른 글

pynq 와 arty  (0) 2025.06.27
EBAZ4205 zynq  (0) 2025.03.25
xilinx vdma  (0) 2025.01.16
ftdi jtag  (0) 2023.07.22
xilinx zynq jtag  (2) 2023.07.21
Posted by 구차니