asrlora / asr_lora_6601

44 stars 18 forks source link

gpio_set_iomux() freeze #10

Open barbiani opened 4 months ago

barbiani commented 4 months ago

Hi,

We are trying to use GPIO7 as push-pull pin, but the cpu freezes while doing so.

Currently, firmware flash is done via serial port. No SWD in use.

Thank you for any tips.

gpio_t *gpiox = GPIOA;

gpio_init(gpiox, GPIO_PIN_7, GPIO_MODE_OUTPUT_PP_HIGH);
gpio_set_iomux(gpiox, GPIO_PIN_7, 0); // hangs here
gpio_write(gpiox, GPIO_PIN_7, GPIO_LEVEL_HIGH);
gpio_write(gpiox, GPIO_PIN_7, GPIO_LEVEL_LOW);
xunyueli commented 1 week ago

gpio06&gpio07 are configured as SWD by default and need to be disabled before they can be used for general IO