Skip to content

Commit df49fbf

Browse files
committed
Fix GPIO pin assignment
1 parent 9c4732e commit df49fbf

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

hal/nrf5340.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,13 @@ int hal_flash_protect(uint32_t start, uint32_t len)
807807
static void periph_unsecure() {
808808
/* Unsecure both GPIO ports */
809809
SPU_PERIPHID_PERM(GPIO_PERIPHID) &= ~SPU_PERIPHID_PERM_SECATTR;
810-
//SPU_GPIOPORT_PERM(0) = (1 << 29);
811810
SPU_GPIOPORT_PERM(0) = 0;
812811
SPU_GPIOPORT_PERM(1) = 0;
813812

813+
/* Assign LED2 GPIO pin to net core; cannot be done by app because MCUSEL
814+
* is only accessible from secure code */
815+
GPIO_PIN_CNF(0, 29) = (GPIO_CNF_OUT | GPIO_CNF_MCUSEL(1));
816+
814817
/* Unsecure UARTE0 */
815818
SPU_PERIPHID_PERM(SERIAL0_PERIPHID) &= ~SPU_PERIPHID_PERM_SECATTR;
816819

test-app/app_nrf5340.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,10 @@ void main(void)
4747
uint32_t app_version;
4848

4949
GPIO_PIN_CNF(port, pin) = GPIO_CNF_OUT;
50+
#ifndef TZEN
5051
/* Allow network core access to P0.29 GPIO */
5152
GPIO_PIN_CNF(0, 29) = (GPIO_CNF_OUT | GPIO_CNF_MCUSEL(1));
53+
#endif
5254

5355
app_version = wolfBoot_current_firmware_version();
5456

0 commit comments

Comments
 (0)