2019. 6. 26. 16:51ㆍ임베디드/32F429IDISCOVERY
MSPs are user callback functions to perform system level initializations such as (Clock, GPIOs, DMA, interrupts). The peripheral initialization is done through HAL_PPP_Init() while the hardware resources initialization used by a peripheral (PPP) is performed during this initialization by calling MSP callback function HAL_PPP_MspInit(). The MspInit callback performs the low-level initialization related to the different additional hardware resources: RCC, GPIO, NVIC and DMA.
소스파일 중 main.c 밑에 있는 stm32f4xx_hal_msp.c의 역할에 대해서 다음과 같이 기술되어 있다.
요약하자면 HAL_PPP_Init()을 하기 전에 반드시 HAL_PPP_MspInit()이 수행된다. 그 이유는 HAL_PPP_MspInit()는 하드웨어 자원과(RCC, GPIO, NVIC and DMA) 연관된 로우 레벨에서의 초기화 함수다
예를 들어, UART를 초기화 한다고 하면 HAL_PPP_Init()에서는 단순히 UART 속성을 정해주지만 HAL_PPP_MspInit()에서 이미 GPIO_AF 선언을 해서 해당 GPIO 핀을 UART로 사용할 수 있게 초기화 시켜주고 있다
'임베디드 > 32F429IDISCOVERY' 카테고리의 다른 글
32F429IDISCOVERY HAL GPIO EXTI 사용하기 (0) | 2019.06.28 |
---|---|
tiny_printf 사용유무에 따른 프로그램 크기 차이 (0) | 2019.06.27 |
HAL 라이브러리 구성 (0) | 2019.06.25 |
Dynamic_printf를 사용한 Tick 측정 (0) | 2019.06.22 |
Push-Pull을 사용하는 이유 (0) | 2019.06.19 |