‎2022-03-16 10:12 AM
‎2022-03-16 10:27 AM
Yes
‎2022-03-16 10:38 AM
.
‎2022-03-16 11:09 AM
Can you tell me what files I must change to have the communication?:grinning_face_with_sweat:
‎2022-03-16 11:27 AM
You don't mention a board, but typically the builds have an xyz_hw_conf.h type file, and that addresses 95% of things that need definitions changed. Might need to chase down an interrupt handler and GPIO_AF​ setting, or double check them.
‎2022-03-16 12:40 PM
ok, I use B-L072Z, I had seen the pin configuration for usart2 but when modifying the pins and functions so that they remain in usart1 on pin 9a and 10a, when uploading the program to the card the com port leaves to transmit data, I don't know what I missing
‎2022-03-16 01:14 PM
STM32CubeExpansion_LRWAN_V1.3.1\Projects\B-L072Z-LRWAN1\Applications\LoRa\PingPong\Core\inc\mlm32l0xx_hw_conf.h
...
/* --------------------------- USART HW definition -------------------------------*/
#define USARTx USART2
#define USARTx_CLK_ENABLE() __USART2_CLK_ENABLE();
#define USARTx_RX_GPIO_CLK_ENABLE() __GPIOA_CLK_ENABLE()
#define USARTx_TX_GPIO_CLK_ENABLE() __GPIOA_CLK_ENABLE()
#define DMAx_CLK_ENABLE() __HAL_RCC_DMA1_CLK_ENABLE()
#define USARTx_FORCE_RESET() __USART2_FORCE_RESET()
#define USARTx_RELEASE_RESET() __USART2_RELEASE_RESET()
#define USARTx_TX_PIN GPIO_PIN_2
#define USARTx_TX_GPIO_PORT GPIOA
#define USARTx_TX_AF GPIO_AF4_USART2
#define USARTx_RX_PIN GPIO_PIN_3
#define USARTx_RX_GPIO_PORT GPIOA
#define USARTx_RX_AF GPIO_AF4_USART2
/* Definition for USARTx's NVIC */
#define USARTx_IRQn USART2_IRQn
#define USARTx_IRQHandler USART2_IRQHandler
/* Definition for USARTx's DMA */
#define USARTx_TX_DMA_CHANNEL DMA1_Channel7
/* Definition for USARTx's DMA Request */
#define USARTx_TX_DMA_REQUEST DMA_REQUEST_4
/* Definition for USARTx's NVIC */
#define USARTx_DMA_TX_IRQn DMA1_Channel4_5_6_7_IRQn
#define USARTx_DMA_TX_IRQHandler DMA1_Channel4_5_6_7_IRQHandler
#define USARTx_Priority 0
#define USARTx_DMA_Priority 0
...
‎2022-03-16 01:16 PM
>>I don't know what I missing
Would suggest doing grep / find-in-file
USART1
USART2
USARTx
Confirm you've identified ALL use cases, things are mapped to USARTx naming
That the interrupts, DMA, and assorted references point to USART1 compatible resources.