embeded/Cortex-M4 STM2026. 2. 6. 11:15

ART ON/OFF가 보이는데 정작 끄는법이나 켜는 법 혹은 클럭 트리에서 설정법이 안보여서 찾는데..

G4는 아닌 F4 쪽에서는 아래의 명령을 이용해서 켜고 끈다고 한다.

FLASH->ACR = FLASH_ACR_ICEN |FLASH_ACR_DCEN |FLASH_ACR_LATENCY_5WS;

[링크 : https://community.st.com/t5/stm32-mcus-products/enable-disable-art-accelerator/td-p/551007]

 

 

[링크 : https://www.st.com/resource/en/product_training/STM32G4-Memory-Flash_FLASH.pdf]

 

3.1 Firmware tips and tricks
3.1.1 Common firmware configuration
ART configuration
The ART Accelerator™ is a memory accelerator which is optimized for STM32 ARM® Cortex™-Mx processors. It balances the inherent performance advantage of the ARM Cortex-Mx over Flash memory technologies, which normally requires the processor to wait for the Flash memory at higher operating frequencies. Thanks to the ART Accelerator™, the CPU can operate up to 120 MHz without wait states, thereby increasing the overall system speed and efficiency.
To release the full processor 150 DMIPS performance at this frequency, the accelerator implements an instruction prefetch queue and instruction/data, which enables program execution from Flash memory at up to 120 MHz without wait states.

To avoid extra power consumption it is recommended to configure the ART as follows:
/* Disable prefetch buffer */
 FLASH->ACR & = ~FLASH_ACR_PRFTEN;
/* Enable flash instruction cache */
 FLASH->ACR |= FLASH_ACR_ICEN;
/* Enable flash data cache */
 FLASH->ACR |= FLASH_ACR_DCEN;

The system performance can be adjusted to the current needs. This can be done either from start, according to performance estimations, or on-the-fly on a running system to adjust the performance to the current condition. In this way the prefetch can be enabled or disabled on-the-fly depending on user needs.
Disabling the prefetch buffer avoids extra Flash access that consumes 20 mA for 128-bit line fetching.

[링크 : https://www.st.com/resource/en/application_note/dm00033348.pdf]

 

I read in that document: STMicroelectronics: AN3430 - Application Note of How to achieve the lowest current consumption with STM32F2xx

On page 17 (3.1.1) they say that enabling the buffer prefetch will consume additional 20mA (for 128-bit-line fetching). Maybe at 168 MHz you power supply gets unstable?? Maybe you can try it with lower clock speed (120MHz), where the cpu is very power efficient.

[링크 : https://stackoverflow.com/questions/11358547/how-to-enable-art-accelerator-stm32f407vgt6]

 

그래서 프로젝트에서 검색해보니 이렇게 걸려 나오는데

HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError)
HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit)

__RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_OB_DBankConfig(uint32_t DBankConfig)

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)

 

ICEN은 Program 쪽에서는 빠진다. 아무래도 데이터 쪽이라 그런가?

HAL_StatusTypeDef HAL_FLASHEx_Erase(FLASH_EraseInitTypeDef *pEraseInit, uint32_t *PageError)
HAL_StatusTypeDef HAL_FLASHEx_Erase_IT(FLASH_EraseInitTypeDef *pEraseInit)

__RAM_FUNC HAL_StatusTypeDef HAL_FLASHEx_OB_DBankConfig(uint32_t DBankConfig)

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

stm32g473 flash doubleword  (0) 2026.02.04
STM32G47x dual bank flash  (0) 2026.02.03
STM32F429I-DISC1 with lvgl  (0) 2026.02.03
32F469IDISCOVERY with lvgl  (0) 2026.02.02
UM2195 audio streaming Expansion Package for STM32Cube  (0) 2026.01.05
Posted by 구차니
embeded/ARM2026. 2. 6. 07:43

ARM의 NPU IP

[링크 : https://www.thelec.kr/news/articleView.html?idxno=51835]

 

[링크 : https://www.arm.com/products/silicon-ip-cpu/ethos/ethos-u85]

 

이걸 직접 채택한데는 르네사스 외에는 딱히 언급이 안되는 느낌.

그 와중에 구형이다. 신형은 없나..

RA8P1
1GHz Arm Cortex-M85 and Ethos-U55 NPU Based AI Microcontroller

[링크 : https://www.renesas.com/en/products/ra8p1?utm_campaign=mcu_ra8p1-empr&utm_source=businesswire&utm_medium=pr&utm_creative=link&utm_content=pp&utm_term=&utm_type=feat]

[링크 : https://www.edge-ai-vision.com/2025/07/renesas-sets-new-mcu-performance-bar-with-1-ghz-ra8p1-devices-with-ai-acceleration/]

 

M85 계열이면 얘를 탑재했을지도?

 Ethos-U85와 최신의 마이크로컴퓨터용 프로세서 코어 「Cortex-M85」등을 조합한 「Arm Corstone-320」도 발표

[링크 : https://coolenjoy.net/bbs/38/5519658]

 

조금 더 찾아보니 MCU은 아니고 SoC 계열로 i.mx93에 ethos-u65 탑재, i.mx93은 cortex-a55 * 2 + cortex-m33 조합이다.

[링크 : https://www.nxp.com/docs/en/application-note/AN13854.pdf]

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

SVE(Scalable Vector Extension)  (0) 2025.08.28
emmc 파티션 정렬  (0) 2024.02.07
arm asm rev  (0) 2023.09.14
cortex-a53  (0) 2023.08.31
aarch64 vector register  (0) 2023.08.23
Posted by 구차니
embeded/esp322026. 2. 5. 09:59

윈도우용 인스톨러 보려는데 5.x 만 지원하고, 6.x 를 쓰려면 다른 gui 인스톨러 써보라고 한다. -_-

[링크 : https://dl.espressif.com/dl/esp-idf/?idf=4.3]

 

내가 필요로 하는건 4.3인데 vscode 에서 깔아 보라고 한다. 흐음..

[링크 : https://e8ch.tistory.com/21]

 

5.x 아니면 윈도우는 포기하는게 나을지도?

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

esp32 와 ili9341 direction  (0) 2026.01.23
esp32-wroom-32 보드 / arduino 개발툴  (0) 2026.01.23
esp32-2432S028 데모 빌드  (0) 2026.01.21
esp32-2432S028 데이터 시트  (0) 2026.01.17
esp32-2432S028 보드 st7789 spi lcd driver?  (0) 2026.01.16
Posted by 구차니
embeded/Cortex-M4 STM2026. 2. 4. 17:12

일단 코드 상으로는 FAST는 안 먹어서 찾아봐야겠고, doubleword 로만 써진다.

 

일단은 DBANK는 체크되어 있는게 기본값이고

 

bank1에 0802000에 쓰니 쓰여지긴 한데 64bit wide라서 의도한대로 딱딱 붙어있지 않고 4byte씩 띄엄띄엄 써진다.

 

해당 페이지 삭제하려고 했는데 0x0802 0000이 아닌 0x0804 0000 이고

체크하고 삭제하면 삭제되었다고 메시지는 뜨지만

 

정작 해당 위치를 다시 가면 내용이 남아있다.

그 와중에 0x0804 0000 위치로 가면 비어있는걸로 나온다.

 

먼가 이상한데.. 머가 이상한거라고 딱찝어 말하기 힘드네..

 

CubeProgrammer를 버전업해봐야하나? 2.21 버전이 최신이었던것 같은데..

 

2.21.0 흐음... 

[링크 : https://www.st.com/en/development-tools/stm32cubeprog.html]

 

+

웃긴게 sdk 문제인지

bank 2에 page 0 대신

bank 1 에 page 64로 하면 잘된다. 머냐?

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

stm32g473 ART accelerator on/off ?  (0) 2026.02.06
STM32G47x dual bank flash  (0) 2026.02.03
STM32F429I-DISC1 with lvgl  (0) 2026.02.03
32F469IDISCOVERY with lvgl  (0) 2026.02.02
UM2195 audio streaming Expansion Package for STM32Cube  (0) 2026.01.05
Posted by 구차니
embeded/Cortex-M7 STM2026. 2. 3. 18:19

페이지라고 해야하나.. 아무튼 섹터별로 용량이 균등하지 않은 녀석도 있다.

 

그리고 듀얼 뱅크와 싱글 뱅크의 경우 일종의 raid 0 처럼 분할해서 striping 되어 저장된다.

[링크 : https://www.st.com/resource/en/application_note/an4826-stm32f7-series-flash-memory-dual-bank-mode-stmicroelectronics.pdf]

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

stm32f746g-disco with semtech sx1276 and lvgl  (0) 2026.02.03
modbus rtu coil read  (0) 2024.10.10
stm32 __weak  (0) 2024.10.08
stm32 modbus  (0) 2024.09.26
SPI NSS, NSSP mode  (0) 2024.09.11
Posted by 구차니
embeded/Cortex-M4 STM2026. 2. 3. 17:58

플래시가 연속된 주소가 아니게 보인다.

63번 0x0801 F800

64번 0x0804 0000 신기하네..

 

Option Byte 에는 BFB2 / DBANK 등이 처음보는 녀석이고..

 

내용은 좀 더 봐야 할 듯.

ART/MIF 를 통해서 NVM Bank 1 / 2에 접근하는거라면.. ART를 그럼 사실상 강제하게 되는건가?

 

서로 다른 채널에 read / write 를 동시에 할 수 있다가 dual bank 의 장점인가?

The dual bank memory can be configured and used as a single large NVM block with continuous addressing (with few exceptions, not covered in this document). There are significant advantages when the NVM is configured to serve as two parallel blocks, the most important is the possibility to write on one bank without interrupting reading (and fetching instructions) from the other bank. This is the most important prerequisite to perform the updates without breaking the execution of the code from the program NVM.

[링크 : https://www.st.com/resource/en/application_note/an4767-onthefly-firmware-update-for-dual-bank-stm32-microcontrollers-stmicroelectronics.pdf]

 

Option byte의 DBANK 설정에 따라서

뱅크를 1개 쓰냐 2개 쓰냐인데

0으로 하면 싱글 뱅크, 4 Kbyte Page * 128 이 되고

1으로 하면 듀얼 뱅크, 2 Kbyte Page * 128 * 2가 되는건가?

 

ART를 켜면 올라가는걸 보면 일단 높은 수치가 성능이 좋은거 같은데,

ART OFF 에서 Single Bank가 성능이 더 좋은다고 보면되나?

[링크 : https://www.st.com/resource/en/product_training/STM32G4-Memory-Flash_FLASH.pdf]

 

+

2026.02.04

심심해서(?) DBANK 풀고

 

내부 플래시 구조를 보니

개별 페이지(?)당 용량은 2배로 늘고

총 페이지는 절반으로 줄어들었다.

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

stm32g473 ART accelerator on/off ?  (0) 2026.02.06
stm32g473 flash doubleword  (0) 2026.02.04
STM32F429I-DISC1 with lvgl  (0) 2026.02.03
32F469IDISCOVERY with lvgl  (0) 2026.02.02
UM2195 audio streaming Expansion Package for STM32Cube  (0) 2026.01.05
Posted by 구차니
embeded/Cortex-M7 STM2026. 2. 3. 12:31

액정은 큰 거 치고는 해상도가 낮다.

그래도 PSP 해상도라고(!) 130,560 pixel 이고 320x240의 76,800 pixel 에 비하면 거의 2배에 가까운 나름(!) 고해상도다.

  • STM32F746NGH6 Arm® Cortex® core-based microcontroller with 1 Mbyte of Flash memory and 340 Kbytes of RAM, in BGA216 package
  • 4.3” RGB 480×272 color LCD-TFT with capacitive touch screen
  • Ethernet compliant with IEEE-802.3-2002
  • USB OTG HS
  • USB OTG FS
  • SAI audio codec
  • Two ST-MEMS digital microphones
  • 128-Mbit Quad-SPI Flash memory
  • 128-Mbit SDRAM (64 Mbits accessible)

[링크 : https://www.st.com/en/evaluation-tools/32f746gdiscovery.html]

 

이건 또 어떻게 살리냐..

[링크 : https://www.semtech.com/products/wireless-rf/lora-connect/sx1276mb1las]

 

일단 이거부터 빌드해서 넣어보자!

[링크 : https://github.com/lvgl/lv_port_stm32f746_disco]

 

응~ 에러

라는데 웃긴건 elf 파일이 생성되어 있다.

arm-none-eabi-gcc -o "lv_port_stm32f746_disco.elf" @"objects.list"   -mcpu=cortex-m7 -T"/home/falinux/work/src/lv_port_stm32f746_disco/LinkerScript.ld" --specs=nosys.specs -Wl,-Map="lv_port_stm32f746_disco.map" -Wl,--gc-sections -static --specs=nano.specs -mfpu=fpv5-sp-d16 -mfloat-abi=hard -mthumb -Wl,--start-group -lc -lm -Wl,--end-group
/opt/st/stm32cubeide_1.16.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: warning: /opt/st/stm32cubeide_1.16.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/thumb/v7e-m+fp/hard/crtn.o: missing .note.GNU-stack section implies executable stack
/opt/st/stm32cubeide_1.16.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/opt/st/stm32cubeide_1.16.0/plugins/cohttp://m.st.stm32cube.ide.mcu.externaltools.gnu-tools-for-stm32.12.3.rel1.linux64_1.0.200.202406132123/tools/bin/../lib/gcc/arm-none-eabi/12.3.1/../../../../arm-none-eabi/bin/ld: warning: lv_port_stm32f746_disco.elf has a LOAD segment with RWX permissions
Finished building target: lv_port_stm32f746_disco.elf
 
arm-none-eabi-size  lv_port_stm32f746_disco.elf 
   text    data     bss     dec     hex filename
 617604    1064  204368  823036   c8efc lv_port_stm32f746_disco.elf
Finished building: default.size.stdout
arm-none-eabi-objdump -h -S lv_port_stm32f746_disco.elf  > "lv_port_stm32f746_disco.list"
 
arm-none-eabi-objcopy  -O binary lv_port_stm32f746_disco.elf  "lv_port_stm32f746_disco.bin"
Finished building: lv_port_stm32f746_disco.bin
 
Finished building: lv_port_stm32f746_disco.list
 

12:38:35 Build Failed. 1 errors, 2 warnings. (took 53s.960ms)

 

cortex-m7 이라 기대했는데 해상도 때문인가 느리다?!

 

 

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

stm32f7 dual bank flash  (0) 2026.02.03
modbus rtu coil read  (0) 2024.10.10
stm32 __weak  (0) 2024.10.08
stm32 modbus  (0) 2024.09.26
SPI NSS, NSSP mode  (0) 2024.09.11
Posted by 구차니
embeded/Cortex-M4 STM2026. 2. 3. 11:30

그냥 받아서 하니 잘된다.

 

git clone https://github.com/littlevgl/stm32f429_disco_no_os_sw4stm32.git --recurse-submodules

[링크 : https://github.com/lvgl/lv_port_stm32f429_disco]

 

회사에 굴러 다니던게 있었을 줄이야 -_-

[링크 : https://www.st.com/en/evaluation-tools/32f429idiscovery.html]

 

  • Core: Arm® 32-bit Cortex®-M4 CPU with FPU, Adaptive real-time accelerator (ART Accelerator™) allowing 0-wait state execution from flash memory, frequency up to 180 MHz, MPU, 225 DMIPS/1.25 DMIPS/MHz (Dhrystone 2.1), and DSP instructions
  • Memories
    • 512 bytes of OTP memory
    • Up to 2 MB of flash memory organized into two banks allowing read-while-write
    • Up to 256+4 KB of SRAM including 64 KB of CCM (core coupled memory) data RAM
    • Flexible external memory controller with up to 32-bit data bus: SRAM, PSRAM, SDRAM/LPSDR SDRAM, compact flash/NOR/NAND memories
  • LCD parallel interface, 8080/6800 modes
  • LCD-TFT controller with fully programmable resolution (total width up to 4096 pixels, total height up to 2048 lines and pixel clock up to 83 MHz)
  • Chrom-ART Accelerator™ for enhanced graphic content creation (DMA2D)

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

 

그나저나 main 함수 엄청 단촐하다.

int main(void)
{

HAL_Init();

/* Configure the system clock to 180 MHz */
SystemClock_Config();

/*Start up indication*/
BSP_LED_Init(LED3);
uint32_t i;
for (i = 0; i < 8; i++) {
BSP_LED_Toggle(LED3);
HAL_Delay(50);
}

lv_init();

tft_init();
touchpad_init();

// lv_example_scroll_3();
// lv_example_chart_7();

lv_demo_widgets();

while (1)
{
HAL_Delay(3);
lv_task_handler();
}
}

 

 

빌드하니 생각외로 용량은 적게 나온다. 이미지는 어떻게 처리한거지?

 

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

stm32g473 flash doubleword  (0) 2026.02.04
STM32G47x dual bank flash  (0) 2026.02.03
32F469IDISCOVERY with lvgl  (0) 2026.02.02
UM2195 audio streaming Expansion Package for STM32Cube  (0) 2026.01.05
stm32g4 cordic fmac  (0) 2025.11.28
Posted by 구차니
embeded/Cortex-M4 STM2026. 2. 2. 17:55

곧 다뤄보게 될 예정.

STM32F469 high-performance MCUs with ARM®Cortex®-M4 core and Chrom-ART Accelerator™
4 inches 800x480 pixel TFT color LCD with MIPI DSI interface and capacitive touch screen

[링크 : https://www.st.com/en/evaluation-tools/32f469idiscovery.html#overview]

 

spi가 아니라 dsi 라서 걱정했는데 다행히(!) 누군가가 benchmark 포팅해서 올려놔서 좀 날로 먹을수 있을 듯.

[링크 : https://github.com/lvgl/lv_port_stm32f469_disco/tree/master]

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

STM32G47x dual bank flash  (0) 2026.02.03
STM32F429I-DISC1 with lvgl  (0) 2026.02.03
UM2195 audio streaming Expansion Package for STM32Cube  (0) 2026.01.05
stm32g4 cordic fmac  (0) 2025.11.28
STM32CubeProgrammer / uart / parity  (0) 2025.11.28
Posted by 구차니
embeded/Cortex-M3 STM2026. 1. 29. 15:48

pc13번 언급이 있어서 확인해보니 RTC_OUT / RTC_TAMPER로 설정이 가능하다.

 

Tamper를 활성화 하면 RTC_OUT 에서 RTC Output on the Tamper pin이 사용 불가능해진다.

 

Tamper는 인터럽트가 있는걸 봐서는.. 일종의 input 으로 설정되나보다.

 

rtc_Tamper를 rtc out으로 쓰지 않으면, 기본으로 tamper는 disble 되는 듯

stm32f1xx_hal_rtc.c

  *** Tamper configuration ***
  ============================
  [..]
    (+) Enable the RTC Tamper and configure the Tamper Level using the
        HAL_RTCEx_SetTamper() function. You can configure RTC Tamper with interrupt
        mode using HAL_RTCEx_SetTamper_IT() function.
    (+) The TAMPER1 alternate function can be mapped to PC13


/**
  * @brief  Initializes the RTC peripheral
  * @param  hrtc   pointer to a RTC_HandleTypeDef structure that contains
  *                the configuration information for RTC.
  * @retval HAL status
  */
HAL_StatusTypeDef HAL_RTC_Init(RTC_HandleTypeDef *hrtc)
{
  /* Set Initialization mode */
  if (RTC_EnterInitMode(hrtc) != HAL_OK)
  {
    /* Set RTC state */
    hrtc->State = HAL_RTC_STATE_ERROR;

    return HAL_ERROR;
  }
  else
  {
    /* Clear Flags Bits */
    CLEAR_BIT(hrtc->Instance->CRL, (RTC_FLAG_OW | RTC_FLAG_ALRAF | RTC_FLAG_SEC));

    if (hrtc->Init.OutPut != RTC_OUTPUTSOURCE_NONE)
    {
      /* Disable the selected Tamper pin */
      CLEAR_BIT(BKP->CR, BKP_CR_TPE);
    }

    /* Set the signal which will be routed to RTC Tamper pin*/
    MODIFY_REG(BKP->RTCCR, (BKP_RTCCR_CCO | BKP_RTCCR_ASOE | BKP_RTCCR_ASOS), hrtc->Init.OutPut);
  }
}

 

stm32f1xx_hal_rtc.h

/** @defgroup RTC_output_source_to_output_on_the_Tamper_pin Output source to output on the Tamper pin
  * @{
  */

#define RTC_OUTPUTSOURCE_NONE               0x00000000U                       /*!< No output on the TAMPER pin  */
#define RTC_OUTPUTSOURCE_CALIBCLOCK         BKP_RTCCR_CCO                     /*!< RTC clock with a frequency divided by 64 on the TAMPER pin  */
#define RTC_OUTPUTSOURCE_ALARM              BKP_RTCCR_ASOE                    /*!< Alarm pulse signal on the TAMPER pin  */
#define RTC_OUTPUTSOURCE_SECOND             (BKP_RTCCR_ASOS | BKP_RTCCR_ASOE) /*!< Second pulse signal on the TAMPER pin  */

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

stm32f103 rtc backup register  (0) 2026.01.29
stm32 hal rcc flag  (0) 2026.01.27
stm32 ivt  (0) 2026.01.27
bluepill stm32f103c8t6 USB CDC 리셋이후 안되는 문제  (0) 2026.01.27
stm32cubeide 2.0 에서 ioc 파일이 생성 안되네?  (0) 2026.01.11
Posted by 구차니