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' 카테고리의 다른 글

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
FDE CIE  (0) 2024.09.06
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' 카테고리의 다른 글

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
STM32CubeProgrammer / uart / parity  (0) 2025.11.28
stm32flash 0.5 0.7 버전과 stm32g473  (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' 카테고리의 다른 글

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
stm32flash 0.5 0.7 버전과 stm32g473  (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 구차니
embeded/Cortex-M3 STM2026. 1. 29. 14:39

rtc에 백업 레지스터라고 해서, software reset 걸려도 살아남는게 있다고 ai가 이야기 하길래 검색

rtc 활성화 하고나니 아래 초기화 코드가 추가되서 따라가서 보면 평범한(?) HAL_RTC_Init() 이 있고

/**
  * @brief RTC Initialization Function
  * @param None
  * @retval None
  */
static void MX_RTC_Init(void)
{

  /* USER CODE BEGIN RTC_Init 0 */

  /* USER CODE END RTC_Init 0 */

  /* USER CODE BEGIN RTC_Init 1 */

  /* USER CODE END RTC_Init 1 */

  /** Initialize RTC Only
  */
  hrtc.Instance = RTC;
  hrtc.Init.AsynchPrediv = RTC_AUTO_1_SECOND;
  hrtc.Init.OutPut = RTC_OUTPUTSOURCE_ALARM;
  if (HAL_RTC_Init(&hrtc) != HAL_OK)
  {
    Error_Handler();
  }
  /* USER CODE BEGIN RTC_Init 2 */

  /* USER CODE END RTC_Init 2 */

}

 

HAL_RTC_MspInit()을 통해

stm32f1xx_hal_rtc.c

    (+) To write to the RTC Backup Data registers, use the HAL_RTCEx_BKUPWrite()
        function.
    (+) To read the RTC Backup Data registers, use the HAL_RTCEx_BKUPRead()
        function.

/**
  * @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)
{
  uint32_t prescaler = 0U;
  /* Check input parameters */
  if (hrtc == NULL)
  {
    return HAL_ERROR;
  }

  /* Check the parameters */
  assert_param(IS_RTC_ALL_INSTANCE(hrtc->Instance));
  assert_param(IS_RTC_CALIB_OUTPUT(hrtc->Init.OutPut));
  assert_param(IS_RTC_ASYNCH_PREDIV(hrtc->Init.AsynchPrediv));

#if (USE_HAL_RTC_REGISTER_CALLBACKS == 1)
#else
  if (hrtc->State == HAL_RTC_STATE_RESET)
  {
    /* Allocate lock resource and initialize it */
    hrtc->Lock = HAL_UNLOCKED;

    /* Initialize RTC MSP */
    HAL_RTC_MspInit(hrtc);
  }
}

/**
  * @brief  Initializes the RTC MSP.
  * @param  hrtc   pointer to a RTC_HandleTypeDef structure that contains
  *                the configuration information for RTC.
  * @retval None
  */
__weak void HAL_RTC_MspInit(RTC_HandleTypeDef *hrtc)
{
  /* Prevent unused argument(s) compilation warning */
  UNUSED(hrtc);
  /* NOTE : This function Should not be modified, when the callback is needed,
            the HAL_RTC_MspInit could be implemented in the user file
   */
}

 

백업 레지스터에 접근할수 있도록 풀어준다.
Core/Src/stm32f1xx_hal_msp.c

/**
* @brief RTC MSP Initialization
* This function configures the hardware resources used in this example
* @param hrtc: RTC handle pointer
* @retval None
*/
void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
{
  if(hrtc->Instance==RTC)
  {
  /* USER CODE BEGIN RTC_MspInit 0 */

  /* USER CODE END RTC_MspInit 0 */
    HAL_PWR_EnableBkUpAccess();
    /* Enable BKP CLK enable for backup registers */
    __HAL_RCC_BKP_CLK_ENABLE();
    /* Peripheral clock enable */
    __HAL_RCC_RTC_ENABLE();
  /* USER CODE BEGIN RTC_MspInit 1 */

  /* USER CODE END RTC_MspInit 1 */

  }

}

 

CR_DBP_BB 라는 레지스터에 활성화 해주는것 코드 느낌. 무슨 레지스터인지 따라가긴 귀찮으니 패스

stm32f1xx_hal_pwr.c

/**
  * @brief  Enables access to the backup domain (RTC registers, RTC
  *         backup data registers ).
  * @note   If the HSE divided by 128 is used as the RTC clock, the
  *         Backup Domain Access should be kept enabled.
  * @retval None
  */
void HAL_PWR_EnableBkUpAccess(void)
{
  /* Enable access to RTC and backup registers */
  *(__IO uint32_t *) CR_DBP_BB = (uint32_t)ENABLE;
}

/**
  * @brief  Disables access to the backup domain (RTC registers, RTC
  *         backup data registers).
  * @note   If the HSE divided by 128 is used as the RTC clock, the
  *         Backup Domain Access should be kept enabled.
  * @retval None
  */
void HAL_PWR_DisableBkUpAccess(void)
{
  /* Disable access to RTC and backup registers */
  *(__IO uint32_t *) CR_DBP_BB = (uint32_t)DISABLE;
}

 

아무튼 백업레지스터 접근이 허용되면

HAL_RTCEx_BKUPWrite() 를 통해 쓰고

HAL_RTCEx_BKUPRead() 를 통해 읽을 수 있다.

stm32f1xx_hal_rtc_ex.c

/**
  * @brief  Writes a data in a specified RTC Backup data register.
  * @param  hrtc: pointer to a RTC_HandleTypeDef structure that contains
  *                the configuration information for RTC.
  * @param  BackupRegister: RTC Backup data Register number.
  *          This parameter can be: RTC_BKP_DRx where x can be from 1 to 10 (or 42) to
  *                                 specify the register (depending devices).
  * @param  Data: Data to be written in the specified RTC Backup data register.
  * @retval None
  */
void HAL_RTCEx_BKUPWrite(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister, uint32_t Data)
{
  uint32_t tmp = 0U;

  /* Prevent unused argument(s) compilation warning */
  UNUSED(hrtc);

  /* Check the parameters */
  assert_param(IS_RTC_BKP(BackupRegister));

  tmp = (uint32_t)BKP_BASE;
  tmp += (BackupRegister * 4U);

  *(__IO uint32_t *) tmp = (Data & BKP_DR1_D);
}

/**
  * @brief  Reads data from the specified RTC Backup data Register.
  * @param  hrtc: pointer to a RTC_HandleTypeDef structure that contains
  *                the configuration information for RTC.
  * @param  BackupRegister: RTC Backup data Register number.
  *          This parameter can be: RTC_BKP_DRx where x can be from 1 to 10 (or 42) to
  *                                 specify the register (depending devices).
  * @retval Read value
  */
uint32_t HAL_RTCEx_BKUPRead(RTC_HandleTypeDef *hrtc, uint32_t BackupRegister)
{
  uint32_t backupregister = 0U;
  uint32_t pvalue = 0U;

  /* Prevent unused argument(s) compilation warning */
  UNUSED(hrtc);

  /* Check the parameters */
  assert_param(IS_RTC_BKP(BackupRegister));

  backupregister = (uint32_t)BKP_BASE;
  backupregister += (BackupRegister * 4U);

  pvalue = (*(__IO uint32_t *)(backupregister)) & BKP_DR1_D;

  /* Read the specified register */
  return pvalue;
}

 

F103의 경우 10개가 있나 보다. 그런데 BKP_DRn_D 마스크는 왜 전부 0xFFFF 으로 동일한걸까?

stm32f103xb.h

/******************************************************************************/
/*                                                                            */
/*                            Backup registers                                */
/*                                                                            */
/******************************************************************************/

/*******************  Bit definition for BKP_DR1 register  ********************/
#define BKP_DR1_D_Pos                       (0U)                               
#define BKP_DR1_D_Msk                       (0xFFFFUL << BKP_DR1_D_Pos)         /*!< 0x0000FFFF */
#define BKP_DR1_D                           BKP_DR1_D_Msk                      /*!< Backup data */

/*******************  Bit definition for BKP_DR2 register  ********************/
#define BKP_DR2_D_Pos                       (0U)                               
#define BKP_DR2_D_Msk                       (0xFFFFUL << BKP_DR2_D_Pos)         /*!< 0x0000FFFF */
#define BKP_DR2_D                           BKP_DR2_D_Msk                      /*!< Backup data */

/*******************  Bit definition for BKP_DR3 register  ********************/
#define BKP_DR3_D_Pos                       (0U)                               
#define BKP_DR3_D_Msk                       (0xFFFFUL << BKP_DR3_D_Pos)         /*!< 0x0000FFFF */
#define BKP_DR3_D                           BKP_DR3_D_Msk                      /*!< Backup data */

/*******************  Bit definition for BKP_DR4 register  ********************/
#define BKP_DR4_D_Pos                       (0U)                               
#define BKP_DR4_D_Msk                       (0xFFFFUL << BKP_DR4_D_Pos)         /*!< 0x0000FFFF */
#define BKP_DR4_D                           BKP_DR4_D_Msk                      /*!< Backup data */

/*******************  Bit definition for BKP_DR5 register  ********************/
#define BKP_DR5_D_Pos                       (0U)                               
#define BKP_DR5_D_Msk                       (0xFFFFUL << BKP_DR5_D_Pos)         /*!< 0x0000FFFF */
#define BKP_DR5_D                           BKP_DR5_D_Msk                      /*!< Backup data */

/*******************  Bit definition for BKP_DR6 register  ********************/
#define BKP_DR6_D_Pos                       (0U)                               
#define BKP_DR6_D_Msk                       (0xFFFFUL << BKP_DR6_D_Pos)         /*!< 0x0000FFFF */
#define BKP_DR6_D                           BKP_DR6_D_Msk                      /*!< Backup data */

/*******************  Bit definition for BKP_DR7 register  ********************/
#define BKP_DR7_D_Pos                       (0U)                               
#define BKP_DR7_D_Msk                       (0xFFFFUL << BKP_DR7_D_Pos)         /*!< 0x0000FFFF */
#define BKP_DR7_D                           BKP_DR7_D_Msk                      /*!< Backup data */

/*******************  Bit definition for BKP_DR8 register  ********************/
#define BKP_DR8_D_Pos                       (0U)                               
#define BKP_DR8_D_Msk                       (0xFFFFUL << BKP_DR8_D_Pos)         /*!< 0x0000FFFF */
#define BKP_DR8_D                           BKP_DR8_D_Msk                      /*!< Backup data */

/*******************  Bit definition for BKP_DR9 register  ********************/
#define BKP_DR9_D_Pos                       (0U)                               
#define BKP_DR9_D_Msk                       (0xFFFFUL << BKP_DR9_D_Pos)         /*!< 0x0000FFFF */
#define BKP_DR9_D                           BKP_DR9_D_Msk                      /*!< Backup data */

/*******************  Bit definition for BKP_DR10 register  *******************/
#define BKP_DR10_D_Pos                      (0U)                               
#define BKP_DR10_D_Msk                      (0xFFFFUL << BKP_DR10_D_Pos)        /*!< 0x0000FFFF */
#define BKP_DR10_D                          BKP_DR10_D_Msk                     /*!< Backup data */

#define RTC_BKP_NUMBER 10

 

[링크 : https://fuhehe.tistory.com/27]

 

1.9 Backup registers
RTC_BKPxR, where x=0 to n backup registers (80 bytes), are reset when a tamper detection event occurs. These registers are powered-on by VBAT when VDD is switched off, so that they are not reset by a system reset, and their contents remain valid when the device operates in low-power mode.
Note: The number “n” of backup registers depends on the product. Please refer to Table 15: Advanced RTC features.

[링크 : https://www.st.com/resource/en/application_note/an3371-using-the-hardware-realtime-clock-rtc-in-stm32-f0-f2-f3-f4-and-l1-series-of-mcus-stmicroelectronics.pdf]

 

보안상 문제가 발생하면 그걸 TAMP 라는것 같은데, 아무튼 그 때는 백업 레지스터가 초기화 된다고 한다.

 

[링크 : https://www.st.com/resource/en/product_training/STM32MP1-Security-Tamper_TAMP.pdf]

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

stm32 rtc tamper  (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 구차니
embeded/Cortex-M3 STM2026. 1. 27. 18:26

대충 보니

BOR Reset(brown out detection reset - 전압 강하로 인한 재기동)

PIN Reset (NRST pin reset - 하드웨어 리셋)

POR Reset (Power on Reset)

SFT Reset (Software Reset)

IWDG1 Reset (Independent Watchdog reset)

WWDG Reset (window Watchdog reset)

#define RCC_FLAG_BORRST                ((uint8_t)0x95)
#define RCC_FLAG_PINRST                ((uint8_t)0x96)
#define RCC_FLAG_PORRST                ((uint8_t)0x97)
#define RCC_FLAG_SFTRST                ((uint8_t)0x98)
#define RCC_FLAG_IWDG1RST              ((uint8_t)0x9A)
#define RCC_FLAG_WWDG1RST              ((uint8_t)0x9C)
#define RCC_FLAG_LPWR1RST              ((uint8_t)0x9E)
#define RCC_FLAG_LPWR2RST              ((uint8_t)0x9F)

[링크 : https://community.st.com/t5/stm32-mcus-products/software-reset-flag-sftrstf-in-rcc-csr-register-what-source/td-p/544463]

[링크 : https://community.st.com/t5/stm32-mcus-products/stm32f407-spurious-reset-rcc-flag-pinrst/td-p/147931]

 

저전력 모드 보안 리셋은 멀까?

3.7.2 System reset sources
Power-on reset initializes all registers while system reset reinitializes the system except for
the debug, part of the RCC and power controller status registers, as well as the backup
power domain.
A system reset is generated in the following cases:
• Power-on reset (pwr_por_rst)
• Brownout reset
• Low level on NRST pin (external reset)
• Independent watchdog 1 (from D1 domain)
• Independent watchdog 2 (from D2 domain)
• Window watchdog 1 (from D1 domain)
• Window watchdog 2 (from D2 domain)
• Software reset
• Low-power mode security reset
• Exit from Standby

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

 

stop / standby mode 오갈때 뜨는 듯?

A low-power-mode security reset (which is generated when Stop or Standby mode is entered but is prohibited by the option byte configuration)

[링크 : https://www.st.com/content/ccc/resource/training/technical/product_training/group0/81/96/f3/1a/55/d9/40/52/STM32H7-System-Reset_and_clock_control_RCC/files/STM32H7-System-Reset_and_clock_control_RCC.pdf/_jcr_content/translations/en.STM32H7-System-Reset_and_clock_control_RCC.pdf]

 

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

stm32 rtc tamper  (0) 2026.01.29
stm32f103 rtc backup register  (0) 2026.01.29
stm32 ivt  (0) 2026.01.27
bluepill stm32f103c8t6 USB CDC 리셋이후 안되는 문제  (0) 2026.01.27
stm32cubeide 2.0 에서 ioc 파일이 생성 안되네?  (0) 2026.01.11
Posted by 구차니
embeded/Cortex-M3 STM2026. 1. 27. 17:08

startup_stm32f103retx.s

  .syntax unified
  .cpu cortex-m3
  .fpu softvfp
  .thumb

.global g_pfnVectors
.global Default_Handler

/**
 * @brief  This is the code that gets called when the processor first
 *          starts execution following a reset event. Only the absolutely
 *          necessary set is performed, after which the application
 *          supplied main() routine is called.
 * @param  None
 * @retval : None
*/

  .section .text.Reset_Handler
  .weak Reset_Handler
  .type Reset_Handler, %function
Reset_Handler:


/******************************************************************************
*
* The minimal vector table for a Cortex M3.  Note that the proper constructs
* must be placed on this to ensure that it ends up at physical address
* 0x0000.0000.
*
******************************************************************************/
  .section .isr_vector,"a",%progbits
  .type g_pfnVectors%object
  .size g_pfnVectors, .-g_pfnVectors


g_pfnVectors:

  .word _estack
  .word Reset_Handler
  .word NMI_Handler
  .word HardFault_Handler
  .word MemManage_Handler
  .word BusFault_Handler
  .word UsageFault_Handler
  .word 0
  .word 0
  .word 0
  .word 0
  .word SVC_Handler
  .word DebugMon_Handler
  .word 0
  .word PendSV_Handler
  .word SysTick_Handler
  .word WWDG_IRQHandler
  .word PVD_IRQHandler
  .word TAMPER_IRQHandler
  .word RTC_IRQHandler
  .word FLASH_IRQHandler
  .word RCC_IRQHandler
  .word EXTI0_IRQHandler
  .word EXTI1_IRQHandler
  .word EXTI2_IRQHandler
  .word EXTI3_IRQHandler
  .word EXTI4_IRQHandler
  .word DMA1_Channel1_IRQHandler
  .word DMA1_Channel2_IRQHandler
  .word DMA1_Channel3_IRQHandler
  .word DMA1_Channel4_IRQHandler
  .word DMA1_Channel5_IRQHandler
  .word DMA1_Channel6_IRQHandler
  .word DMA1_Channel7_IRQHandler
  .word ADC1_2_IRQHandler
  .word USB_HP_CAN1_TX_IRQHandler
  .word USB_LP_CAN1_RX0_IRQHandler
  .word CAN1_RX1_IRQHandler
  .word CAN1_SCE_IRQHandler
  .word EXTI9_5_IRQHandler
  .word TIM1_BRK_IRQHandler
  .word TIM1_UP_IRQHandler
  .word TIM1_TRG_COM_IRQHandler
  .word TIM1_CC_IRQHandler
  .word TIM2_IRQHandler
  .word TIM3_IRQHandler
  .word TIM4_IRQHandler
  .word I2C1_EV_IRQHandler
  .word I2C1_ER_IRQHandler
  .word I2C2_EV_IRQHandler
  .word I2C2_ER_IRQHandler
  .word SPI1_IRQHandler
  .word SPI2_IRQHandler
  .word USART1_IRQHandler
  .word USART2_IRQHandler
  .word USART3_IRQHandler
  .word EXTI15_10_IRQHandler
  .word RTC_Alarm_IRQHandler
  .word USBWakeUp_IRQHandler
  .word TIM8_BRK_IRQHandler
  .word TIM8_UP_IRQHandler
  .word TIM8_TRG_COM_IRQHandler
  .word TIM8_CC_IRQHandler
  .word ADC3_IRQHandler
  .word FSMC_IRQHandler
  .word SDIO_IRQHandler
  .word TIM5_IRQHandler
  .word SPI3_IRQHandler
  .word UART4_IRQHandler
  .word UART5_IRQHandler
  .word TIM6_IRQHandler
  .word TIM7_IRQHandler
  .word DMA2_Channel1_IRQHandler
  .word DMA2_Channel2_IRQHandler
  .word DMA2_Channel3_IRQHandler
  .word DMA2_Channel4_5_IRQHandler
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word 0
  .word BootRAM       /* @0x1E0. This is for boot in RAM mode for
                         STM32F10x High Density devices. */

 

STM32F103RETX_FLASH.ld

/* Memories definition */
MEMORY
{
  RAM    (xrw)    : ORIGIN = 0x20000000,   LENGTH = 64K
  FLASH    (rx)    : ORIGIN = 0x8000000,   LENGTH = 512K
}

/* Sections */
SECTIONS
{
  /* The startup code into "FLASH" Rom type memory */
  .isr_vector :
  {
    . = ALIGN(4);
    KEEP(*(.isr_vector)) /* Startup code */
    . = ALIGN(4);
  } >FLASH

  /* The program code and other data into "FLASH" Rom type memory */
  .text :
  {
    . = ALIGN(4);
    *(.text)           /* .text sections (code) */
    *(.text*)          /* .text* sections (code) */
    *(.glue_7)         /* glue arm to thumb code */
    *(.glue_7t)        /* glue thumb to arm code */
    *(.eh_frame)

    KEEP (*(.init))
    KEEP (*(.fini))

    . = ALIGN(4);
    _etext = .;        /* define a global symbols at end of code */
  } >FLASH

  /* Constant data into "FLASH" Rom type memory */
  .rodata :
  {
    . = ALIGN(4);
    *(.rodata)         /* .rodata sections (constants, strings, etc.) */
    *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
    . = ALIGN(4);
  } >FLASH
}

 

$ readelf -a test.elf 
ELF Header:
  Magic:   7f 45 4c 46 01 01 01 00 00 00 00 00 00 00 00 00 
  Class:                             ELF32
  Data:                              2's complement, little endian
  Version:                           1 (current)
  OS/ABI:                            UNIX - System V
  ABI Version:                       0
  Type:                              EXEC (Executable file)
  Machine:                           ARM
  Version:                           0x1
  Entry point address:               0x8009499
  Start of program headers:          52 (bytes into file)
  Start of section headers:          1299152 (bytes into file)
  Flags:                             0x5000200, Version5 EABI, soft-float ABI
  Size of this header:               52 (bytes)
  Size of program headers:           32 (bytes)
  Number of program headers:         4
  Size of section headers:           40 (bytes)
  Number of section headers:         26
  Section header string table index: 25

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [ 1] .isr_vector       PROGBITS        08000000 001000 0001e4 00   A  0   0  1
  [ 2] .text             PROGBITS        080001e8 0011e8 012144 00  AX  0   0  8
  [ 3] .rodata           PROGBITS        08012330 013330 002338 00   A  0   0  8
  [ 4] .ARM.extab        PROGBITS        08014668 01622c 000000 00   W  0   0  1
  [ 5] .ARM              ARM_EXIDX       08014668 015668 000008 00  AL  2   0  4
  [ 6] .preinit_array    PREINIT_ARRAY   08014670 01622c 000000 04  WA  0   0  1
  [ 7] .init_array       INIT_ARRAY      08014670 015670 000004 04   A  0   0  4
  [ 8] .fini_array       FINI_ARRAY      08014674 015674 000004 04   A  0   0  4
  [ 9] .data             PROGBITS        20000000 016000 00022c 00  WA  0   0  4
  [10] .bss              NOBITS          20000230 016230 001b44 00  WA  0   0  8
  [11] ._user_heap_stack NOBITS          20001d74 016d74 000604 00  WA  0   0  1
  [12] .ARM.attributes   ARM_ATTRIBUTES  00000000 01622c 000029 00      0   0  1
  [13] .debug_info       PROGBITS        00000000 016255 01da16 00      0   0  1
  [14] .debug_abbrev     PROGBITS        00000000 033c6b 0056f5 00      0   0  1
  [15] .debug_aranges    PROGBITS        00000000 039360 001bf8 00      0   0  8
  [16] .debug_rnglists   PROGBITS        00000000 03af58 0015ba 00      0   0  1
  [17] .debug_macro      PROGBITS        00000000 03c512 0206fd 00      0   0  1
  [18] .debug_line       PROGBITS        00000000 05cc0f 022fc5 00      0   0  1
  [19] .debug_str        PROGBITS        00000000 07fbd4 0aae1c 01  MS  0   0  1
  [20] .comment          PROGBITS        00000000 12a9f0 000043 01  MS  0   0  1
  [21] .debug_frame      PROGBITS        00000000 12aa34 008440 00      0   0  4
  [22] .debug_line_str   PROGBITS        00000000 132e74 000064 01  MS  0   0  1
  [23] .symtab           SYMTAB          00000000 132ed8 0072e0 10     24 1208  4
  [24] .strtab           STRTAB          00000000 13a1b8 002ffa 00      0   0  1
  [25] .shstrtab         STRTAB          00000000 13d1b2 00011c 00      0   0  1
Key to Flags:
  W (write), A (alloc), X (execute), M (merge), S (strings), I (info),
  L (link order), O (extra OS processing required), G (group), T (TLS),
  C (compressed), x (unknown), o (OS specific), E (exclude),
  D (mbind), y (purecode), p (processor specific)

There are no section groups in this file.

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x001000 0x08000000 0x08000000 0x14678 0x14678 R E 0x1000
  LOAD           0x016000 0x20000000 0x08014678 0x0022c 0x0022c RW  0x1000
  LOAD           0x000230 0x20000230 0x080148a4 0x00000 0x01b44 RW  0x1000
  LOAD           0x000d74 0x20001d74 0x080148a4 0x00000 0x00604 RW  0x1000

 Section to Segment mapping:
  Segment Sections...
   00     .isr_vector .text .rodata .ARM .init_array .fini_array 
   01     .data 
   02     .bss 
   03     ._user_heap_stack 

There is no dynamic section in this file.

There are no relocations in this file.

Unwind section '.ARM' at offset 0x15668 contains 1 entry:

0x8000228 <strlen>: 0x1 [cantunwind]


Symbol table '.symtab' contains 1838 entries:
   Num:    Value  Size Type    Bind   Vis      Ndx Name
     0: 00000000     0 NOTYPE  LOCAL  DEFAULT  UND 
     1: 08000000     0 SECTION LOCAL  DEFAULT    1 .isr_vector
     2: 080001e8     0 SECTION LOCAL  DEFAULT    2 .text
     3: 08012330     0 SECTION LOCAL  DEFAULT    3 .rodata
     4: 08014668     0 SECTION LOCAL  DEFAULT    4 .ARM.extab
     5: 08014668     0 SECTION LOCAL  DEFAULT    5 .ARM
     6: 08014670     0 SECTION LOCAL  DEFAULT    6 .preinit_array
     7: 08014670     0 SECTION LOCAL  DEFAULT    7 .init_array
     8: 08014674     0 SECTION LOCAL  DEFAULT    8 .fini_array
     9: 20000000     0 SECTION LOCAL  DEFAULT    9 .data
    10: 20000230     0 SECTION LOCAL  DEFAULT   10 .bss
    11: 20001d74     0 SECTION LOCAL  DEFAULT   11 ._user_heap_stack
(많아서 생략)

No version information found in this file.
Attribute Section: aeabi
File Attributes
  Tag_CPU_name: "7-M"
  Tag_CPU_arch: v7
  Tag_CPU_arch_profile: Microcontroller
  Tag_THUMB_ISA_use: Thumb-2
  Tag_ABI_PCS_wchar_t: 4
  Tag_ABI_FP_denormal: Needed
  Tag_ABI_FP_exceptions: Needed
  Tag_ABI_FP_number_model: IEEE 754
  Tag_ABI_align_needed: 8-byte
  Tag_ABI_enum_size: small
  Tag_CPU_unaligned_access: v6

 

 

[링크 : https://hackmd.io/@SgyGB0h2QGWBfbHp9n_ArQ/BygAD3fU_]

 

플래시를 읽어보면 

0x8000000 은 _estack 값 같고

0x8000004 는 Reset_Handler의 주소 같다. 그런데 왜 1로 끝나지..? 4바이트 정렬 안하나?

 

근처에 읽어보면 모르겠...다(!)

 

NMI_Handler로 보는데 0x0800 7F01 인데 왜 1로 끝나냐도 모르겠고, 본다고 기계어가 어셈으로 눈에 들어오는것도 아니고..

[링크 : https://fuhehe.tistory.com/13]

 

벡터위치 변경하는 것을 요약하면 



1. 링커스크립트에서 인터럽트벡터가 있는 .isr_vector 섹션의 위치를 수정

2. SystemInit() 함수에서 SCB->VTOR 레지스터를 변경하고자 하는 섹션의 위치로 수정

[링크 : https://m.blog.naver.com/chcbaram/222580261732]

 

암튼 object는 굳이 표현하면 array 나 variable 이라는데

딱히 pointer라는 개념이.. 어셈에 없을리가 없는데 멀까.

For ELF targets, the .type directive is used like this:

.type name , type description
This sets the type of symbol name to be either a function symbol or an object symbol. There are five different syntaxes supported for the type description field, in order to provide compatibility with various other assemblers.

Because some of the characters used in these syntaxes (such as ‘@’ and ‘#’) are comment characters for some architectures, some of the syntaxes below do not work on all architectures. The first variant will be accepted by the GNU assembler on all architectures so that variant should be used for maximum portability, if you do not need to assemble your code with other assemblers.

The syntaxes supported are:

  .type <name> STT_<TYPE_IN_UPPER_CASE>
  .type <name>,#<type>
  .type <name>,@<type>
  .type <name>,%<type>
  .type <name>,"<type>"
The types supported are:

STT_FUNC
function
Mark the symbol as being a function name.

STT_GNU_IFUNC
gnu_indirect_function
Mark the symbol as an indirect function when evaluated during reloc processing. (This is only supported on assemblers targeting GNU systems).

STT_OBJECT
object
Mark the symbol as being a data object.

[링크 : https://sourceware.org/binutils/docs/as/Type.html?utm_source=chatgpt.com]

 

The .type directive allows you to tell the assembler what type a symbol is. Most of the time we just use %function and %object.

                    .type               hexTable,%object

...or...

                    .type               qsort,%function

[링크 : https://developer.arm.com/community/arm-community-blogs/b/architectures-and-processors-blog/posts/useful-assembler-directives-and-macros-for-the-gnu-assembler]

[링크 : https://stackoverflow.com/questions/70061418/what-does-the-object-and-object-mean-in-this-inline-assembly?utm_source=chatgpt.com]

Posted by 구차니
embeded/Cortex-M3 STM2026. 1. 27. 11:35

USB 에서 장치를 다시 인식시키려면, D+ 라인을 풀다운 해주어야 한다고 한다.

그래서 reset 누르고 재기동 하면 ACM이 살아는 있지만 정상적으로 작동을 하지 않는건가?

If you reset the bluepill you need to pull down the D+ line for several milliseconds to let know the host that it has to start the enumeration process.

[링크 : https://stackoverflow.com/questions/54939948/stm32-usb-cdc-after-hardware-reset]

 

USB_DEVICE/App/usb_device.c 에 있는 MX_USB_DEVICE_Init() 을 아래와 같이 추가해준다.

그러면 일정 시간 이후에 다시 붙으면서 /dev/ttyACM0로 데이터가 출력된다.

void MX_USB_DEVICE_Init(void)
{
  /* USER CODE BEGIN USB_DEVICE_Init_PreTreatment */

  /* Rendering hardware reset harmless (no need to replug USB cable): */
  GPIO_InitTypeDef GPIO_InitStruct = {0};

  /* GPIO Ports Clock Enable */
  __HAL_RCC_GPIOA_CLK_ENABLE();

  /*Configure GPIO pin Output Level */
  HAL_GPIO_WritePin(GPIOA, GPIO_PIN_12, GPIO_PIN_RESET);

  /*Configure GPIO pin : PA12, a.k.a. USB_DP */
  GPIO_InitStruct.Pin = GPIO_PIN_12;
  GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  GPIO_InitStruct.Pull = GPIO_NOPULL;
  GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  HAL_GPIO_Init(GPIOA, &GPIO_InitStruct);

  HAL_Delay(5);
  /* Hardware reset rendered harmless! */

  /* USER CODE END USB_DEVICE_Init_PreTreatment */
  ...
}

[링크 : https://stackoverflow.com/questions/54939948/stm32-usb-cdc-after-hardware-reset]

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

stm32 hal rcc flag  (0) 2026.01.27
stm32 ivt  (0) 2026.01.27
stm32cubeide 2.0 에서 ioc 파일이 생성 안되네?  (0) 2026.01.11
stm32cubeide에 x-cube-ai 설치  (0) 2026.01.06
stm32f103c9t6(bluepill) + stlinkv2 + cdc(vcp)  (0) 2026.01.05
Posted by 구차니
embeded/esp322026. 1. 23. 15:54

데이터 시트 상으로는 MX MT 값이 제법 중요해보이는데 MX,MY 값이 안보인다 -_-

[링크 : https://cdn-shop.adafruit.com/datasheets/ILI9341.pdf]

 

BGR은 되는것 같고..

데이터 순서는 동일할텐데 화면을 뒤집으려면

ML / MH만 뒤집어야 하나?

-------

MAC - 0x48

초기값으로 설정된거

 

MAC - 0x00 (landscape + rgb)

 

MAC - 0x08 (landscape + bgr)

 

MAC - 0xC8 (landscape)

MX,MY를 설정해서 데이터 방향을 바꾸어서 180도 rotate

 

MAC - 0x28

portrait를 위해 MV(Row/Column Exchange)

 

MAC - 0x68 (portrait) - 0110 1000 (2)

Portrait 되니 좌우가 바뀌어서 이를 위해 MX(Column Address Order) 뒤집음

 


MAC - 0xA8 (portait invert + bgr) - 1010 1000 (2)

landscape 처럼 방향 뒤집으려면 MX/MY를 뒤집음

 

아래는 부팅 로그(참조용)

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:6992
load:0x40078000,len:14292
ho 0 tail 12 room 4
load:0x40080400,len:3688
entry 0x40080678
I (29) boot: ESP-IDF v4.3 2nd stage bootloader
I (29) boot: compile time 14:34:09
I (29) boot: chip revision: 3
I (32) boot_comm: chip revision: 3, min. bootloader chip revision: 0
I (39) boot.esp32: SPI Speed      : 40MHz
I (43) boot.esp32: SPI Mode       : DIO
I (48) boot.esp32: SPI Flash Size : 2MB
I (53) boot: Enabling RNG early entropy source...
I (58) boot: Partition Table:
I (62) boot: ## Label            Usage          Type ST Offset   Length
I (69) boot:  0 nvs              WiFi data        01 02 00009000 00006000
I (76) boot:  1 phy_init         RF data          01 01 0000f000 00001000
I (84) boot:  2 factory          factory app      00 00 00010000 00100000
I (91) boot: End of partition table
I (95) boot_comm: chip revision: 3, min. application chip revision: 0
I (103) esp_image: segment 0: paddr=00010020 vaddr=3f400020 size=0e41ch ( 58396) map
I (133) esp_image: segment 1: paddr=0001e444 vaddr=3ffb0000 size=01bd4h (  7124) load
I (136) esp_image: segment 2: paddr=00020020 vaddr=400d0020 size=47344h (291652) map
I (249) esp_image: segment 3: paddr=0006736c vaddr=3ffb1bd4 size=00ec8h (  3784) load
I (251) esp_image: segment 4: paddr=0006823c vaddr=40080000 size=0c740h ( 51008) load
I (277) esp_image: segment 5: paddr=00074984 vaddr=50000000 size=00010h (    16) load
I (284) boot: Loaded app from partition at offset 0x10000
I (284) boot: Disabling RNG early entropy source...
I (297) cpu_start: Pro cpu up.
I (297) cpu_start: Starting app cpu, entry point is 0x40081160
I (0) cpu_start: App cpu up.
I (313) cpu_start: Pro cpu start user code
I (313) cpu_start: cpu freq: 160000000
I (313) cpu_start: Application information:
I (318) cpu_start: Project name:     lvgl-demo
I (323) cpu_start: App version:      1
I (327) cpu_start: ELF file SHA256:  af171cc858421945...
I (333) cpu_start: ESP-IDF:          v4.3
I (338) heap_init: Initializing. RAM available for dynamic allocation:
I (345) heap_init: At 3FFAE6E0 len 00001920 (6 KiB): DRAM
I (351) heap_init: At 3FFCFB50 len 000104B0 (65 KiB): DRAM
I (357) heap_init: At 3FFE0440 len 00003AE0 (14 KiB): D/IRAM
I (364) heap_init: At 3FFE4350 len 0001BCB0 (111 KiB): D/IRAM
I (370) heap_init: At 4008C740 len 000138C0 (78 KiB): IRAM
I (377) spi_flash: detected chip: generic
I (381) spi_flash: flash io: dio
W (385) spi_flash: Detected size(4096k) larger than the size in the binary image header(2048k). Using the size in the binary image header.
I (399) cpu_start: Starting scheduler on PRO CPU.
I (0) cpu_start: Starting scheduler on APP CPU.

APP  LittlevGL Demo is start!~
lvgl_helpers->Display hor size: 320, ver size: 240
lvgl_helpers->Display buffer size: 20480
lvgl_helpers->Initializing SPI master for display
lvgl_helpers->Configuring SPI host HSPI_HOST (1)
lvgl_helpers->MISO pin: -1, MOSI pin: 13, SCLK pin: 14
lvgl_helpers->Max transfer size: 40960 (bytes)
lvgl_helpers->Initializing SPI bus...
disp_spi->Adding SPI device
disp_spi->Clock speed: 40000000Hz, mode: 0, CS pin: 15
ILI9341->ili9341 Initialization....
I (1440) ILI9341: Enabling backlight.
ILI9341->Display orientation: PORTRAIT
ILI9341->0x36 command value: 0x48
lvgl_helpers->Initializing SPI master for touch
I (1440) gpio: GPIO[36]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1460) gpio: GPIO[39]| InputEn: 1| OutputEn: 0| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
I (1460) XPT2046: XPT2046 Initialization

 

 

+

ili9341.c

static void ili9341_set_orientation(uint8_t orientation)
{
// ESP_ASSERT(orientation < 4);
const char *orientation_str[] = {"PORTRAIT", "PORTRAIT_INVERTED", "LANDSCAPE", "LANDSCAPE_INVERTED"};
printf("%s->Display orientation: %s\n",TAG, orientation_str[orientation]);
#if defined CONFIG_LVGL_PREDEFINED_DISPLAY_M5STACK
uint8_t data[] = {0x68, 0x68, 0x08, 0x08};
#elif defined (CONFIG_LVGL_PREDEFINED_DISPLAY_WROVER4)
uint8_t data[] = {0x4C, 0x88, 0x28, 0xE8};
#elif defined (CONFIG_LVGL_PREDEFINED_DISPLAY_NONE)
uint8_t data[] = {0x68, 0xA8, 0x08, 0xC8};
#endif
printf("%s->0x36 command value: 0x%02X\n",TAG, data[orientation]);
ili9341_send_cmd(0x36);
ili9341_send_data((void *) &data[orientation], 1);
}

 

sdkconfig

width / height는 320,240 으로 하고 돌리며 된다.

다만 터치는 소스 수정이 좀 많이 필요할 듯.


#
# LVGL TFT Display controller
#
CONFIG_LVGL_PREDEFINED_DISPLAY_NONE=y
# CONFIG_LVGL_PREDEFINED_DISPLAY_WROVER4 is not set
# CONFIG_LVGL_PREDEFINED_DISPLAY_M5STACK is not set
# CONFIG_LVGL_PREDEFINED_DISPLAY_M5STICK is not set
# CONFIG_LVGL_PREDEFINED_DISPLAY_M5STICKC is not set
# CONFIG_LVGL_PREDEFINED_DISPLAY_ERTFT0356 is not set
# CONFIG_LVGL_PREDEFINED_DISPLAY_ADA_FEATHERWING is not set
# CONFIG_LVGL_PREDEFINED_DISPLAY_RPI_MPI3501 is not set
# CONFIG_LVGL_PREDEFINED_DISPLAY_WEMOS_LOLIN is not set
# CONFIG_LVGL_PREDEFINED_DISPLAY_ATAG is not set
# CONFIG_LVGL_PREDEFINED_DISPLAY_RPI_RA8875 is not set
# CONFIG_LVGL_PREDEFINED_DISPLAY_TTGO is not set
CONFIG_LVGL_TFT_DISPLAY_CONTROLLER_ILI9341=y
CONFIG_LVGL_TFT_DISPLAY_PROTOCOL_SPI=y
CONFIG_LVGL_PREDEFINED_PINS_NONE=y
# CONFIG_LVGL_PREDEFINED_PINS_38V4 is not set
# CONFIG_LVGL_PREDEFINED_PINS_30 is not set
# CONFIG_LVGL_PREDEFINED_PINS_38V1 is not set
# CONFIG_LVGL_PREDEFINED_PINS_TKOALA is not set
CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_ILI9341=y
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_ILI9481 is not set
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_ILI9486 is not set
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_ILI9488 is not set
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_ST7789 is not set
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_ST7735S is not set
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_HX8357 is not set
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_SH1107 is not set
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_SSD1306 is not set
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_FT81X is not set
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_IL3820 is not set
# CONFIG_LVGL_TFT_DISPLAY_USER_CONTROLLER_RA8875 is not set
CONFIG_LVGL_TFT_DISPLAY_SPI_HSPI=y
# CONFIG_LVGL_TFT_DISPLAY_SPI_VSPI is not set
CONFIG_LVGL_DISPLAY_ORIENTATION_PORTRAIT=y
# CONFIG_LVGL_DISPLAY_ORIENTATION_PORTRAIT_INVERTED is not set
# CONFIG_LVGL_DISPLAY_ORIENTATION_LANDSCAPE is not set
# CONFIG_LVGL_DISPLAY_ORIENTATION_LANDSCAPE_INVERTED is not set
CONFIG_LVGL_DISPLAY_ORIENTATION=0
CONFIG_LVGL_DISPLAY_WIDTH=320
CONFIG_LVGL_DISPLAY_HEIGHT=240
CONFIG_LVGL_TFT_USE_CUSTOM_SPI_CLK_DIVIDER=y
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_1 is not set
CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_2=y
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_3 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_4 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_5 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_6 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_7 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_8 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_9 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_10 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_12 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_16 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_20 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_24 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_32 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_40 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_48 is not set
# CONFIG_LVGL_TFT_SPI_CLK_DIVIDER_80 is not set
CONFIG_LVGL_TFT_CUSTOM_SPI_CLK_DIVIDER=2
# CONFIG_LVGL_INVERT_DISPLAY is not set
# CONFIG_LVGL_INVERT_COLORS is not set
CONFIG_LVGL_AXP192_PIN_SDA=21
CONFIG_LVGL_AXP192_PIN_SCL=22

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

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
esp32 와 spi lcd 성능 비..교?  (0) 2026.01.12
Posted by 구차니
embeded/esp322026. 1. 23. 15:22

원인은 모르겠으나 3.3.5 로 하면 빌드하다가 쉘에서 어쩌구 하면서 에러가 난다.

경고: 라이브러리 ESP_SR에서 카테고리 'Sound'가 유효하지 않습니다. 'Uncategorized'로 설정
경고: 라이브러리 Hash에서 카테고리 'Security'가 유효하지 않습니다. 'Uncategorized'로 설정
경고: 라이브러리 ESP Insights에서 카테고리 ''가 유효하지 않습니다. 'Uncategorized'로 설정
경고: 라이브러리 ESP RainMaker에서 카테고리 ''가 유효하지 않습니다. 'Uncategorized'로 설정
경고: 라이브러리 TFLite Micro에서 카테고리 ''가 유효하지 않습니다. 'Uncategorized'로 설정
경고: 라이브러리 WiFiProv에서 카테고리 ''가 유효하지 않습니다. 'Uncategorized'로 설정
Archiving built core (caching) in: /tmp/arduino_cache_547584/core/core_esp32_esp32_esp32_JTAGAdapter_default,PSRAM_disabled,PartitionScheme_default,CPUFreq_240,FlashMode_dio,FlashFreq_80,FlashSize_4M,UploadSpeed_921600,LoopCore_1,EventsCore_1,DebugLevel_none,EraseFlash_none,ZigbeeMode_default_302ebf432393f02a3a54f86a94370d90.a
>: -c: 줄 1: `''을(를) 찾는 도중 예상치 못한 파일의 끝
>: -c: 줄 2: 문법 오류: 예기치 않은 파일의 끝
exit status 2
보드 ESP32 Dev Module 컴파일 에러.

 

그래서 혹시 몰라 3.2.1를 받아서 하니 잘된다. 이게 머야 -_-

 

귀찮아서 빌드 테스트를 위해

예제 > ESP32 > ChipID 해서 빌드하니 잘된다.

 

어디서 주워듣기로는 DIO로 하라는데 QIO던 DIO던 잘되니 상관없나..

 

부팅시에 부트로더 메시지에서 mode DIO로 나오니.. DIO 로 해야할 느낌?

rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4888
load:0x40078000,len:16456
load:0x40080400,len:4
load:0x40080404,len:3476
entry 0x400805b4

 

실행되고 시리얼 모니터로 보는데, 부트로더 에러나서 같은거 계속 출력하는 줄.. -_-

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

esp32 와 ili9341 direction  (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
esp32 와 spi lcd 성능 비..교?  (0) 2026.01.12
Posted by 구차니