Skip to content

Commit af94d67

Browse files
mattia-moffadanielinux
authored andcommitted
Address more copilot remarks
1 parent 39d1507 commit af94d67

5 files changed

Lines changed: 14 additions & 68 deletions

File tree

docs/Targets.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4593,7 +4593,6 @@ not interact with the RISC-V coprocessor.
45934593
Two configurations are available at `config/examples`:
45944594

45954595
- `nrf54l15.config`: TrustZone disabled; wolfBoot and the application always run in secure mode.
4596-
Delta updates are enabled.
45974596

45984597
- `nrf54l15-wolfcrypt-tz.config`: TrustZone enabled; wolfBoot runs in secure mode and boots the
45994598
application as non-secure code. Includes a non-secure callable (NSC) wolfPKCS11 API for

hal/nrf54l.c

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -308,60 +308,6 @@ void uart_init(void)
308308
}
309309
#endif
310310

311-
static uintptr_t ext_flash_addr_calc(uintptr_t address)
312-
{
313-
/* offset external flash addresses by the update partition address */
314-
if (address < WOLFBOOT_PARTITION_UPDATE_ADDRESS) {
315-
return 0;
316-
}
317-
address -= WOLFBOOT_PARTITION_UPDATE_ADDRESS;
318-
return address;
319-
}
320-
321-
int ext_flash_write(uintptr_t address, const uint8_t *data, int len)
322-
{
323-
#ifdef DEBUG_FLASH
324-
uintptr_t addr = ext_flash_addr_calc(address);
325-
wolfBoot_printf("Ext Write: Len %d, Addr 0x%" PRIxPTR " (off 0x%" PRIxPTR
326-
") -> %p\n",
327-
len, address, addr, data);
328-
#endif
329-
return 0;
330-
}
331-
332-
int ext_flash_read(uintptr_t address, uint8_t *data, int len)
333-
{
334-
#ifdef DEBUG_FLASH
335-
uintptr_t addr = ext_flash_addr_calc(address);
336-
wolfBoot_printf("Ext Read: Len %d, Addr 0x%" PRIxPTR " (off 0x%" PRIxPTR
337-
") -> %p\n",
338-
len, address, addr, data);
339-
#endif
340-
memset(data, FLASH_BYTE_ERASED, len);
341-
return len;
342-
}
343-
344-
int ext_flash_erase(uintptr_t address, int len)
345-
{
346-
#ifdef DEBUG_FLASH
347-
uintptr_t addr = ext_flash_addr_calc(address);
348-
wolfBoot_printf("Ext Erase: Len %d, Addr 0x%" PRIxPTR " (off 0x%" PRIxPTR
349-
")\n",
350-
len, address, addr);
351-
#endif
352-
return 0;
353-
}
354-
355-
void ext_flash_lock(void)
356-
{
357-
/* no op */
358-
}
359-
360-
void ext_flash_unlock(void)
361-
{
362-
/* no op */
363-
}
364-
365311
static void high_freq_clock_init(void)
366312
{
367313
/* Start the HFXO and wait until it is running */

hal/spi/spi_drv_nrf54l.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,9 @@ void RAMFUNCTION spi_write(const char byte)
9595
SPI_EVENTS_DMA_TX_BUSERROR == 0)
9696
;
9797
SPI_EVENTS_STOPPED = 0;
98-
spi_rx_ready = 1;
98+
99+
if (SPI_EVENTS_DMA_RX_BUSERROR == 0 && SPI_EVENTS_DMA_RX_BUSERROR == 0)
100+
spi_rx_ready = 1;
99101
}
100102

101103

@@ -113,9 +115,9 @@ void spi_init(int polarity, int phase)
113115
GPIO_PIN_CNF(SPI_MISO_PORT, SPI_MISO_PIN) =
114116
(GPIO_CNF_IN | GPIO_CNF_PULL_UP);
115117

116-
GPIO_OUTSET(SPI_CS_PORT) = (1 << SPI_CS_PIN);
117-
GPIO_OUTCLR(SPI_SCK_PORT) = (1 << SPI_SCK_PIN);
118-
GPIO_OUTCLR(SPI_MOSI_PORT) = (1 << SPI_MOSI_PIN);
118+
GPIO_OUTSET(SPI_CS_PORT) = (1U << SPI_CS_PIN);
119+
GPIO_OUTCLR(SPI_SCK_PORT) = (1U << SPI_SCK_PIN);
120+
GPIO_OUTCLR(SPI_MOSI_PORT) = (1U << SPI_MOSI_PIN);
119121

120122
SPI_ENABLE_REG = SPIM_ENABLE_ENABLE_Disabled;
121123
SPI_PSEL_MISO = (PSEL_PORT(SPI_MISO_PORT) | SPI_MISO_PIN);

hal/spi/spi_drv_nrf54l.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,28 +24,28 @@
2424

2525
/* Default pin-mux matches the nRF54L15-DK */
2626
#ifndef SPI_CS_PORT
27-
#define SPI_CS_PORT 0
27+
#define SPI_CS_PORT 2
2828
#endif
2929
#ifndef SPI_CS_PIN
30-
#define SPI_CS_PIN 25
30+
#define SPI_CS_PIN 5
3131
#endif
3232
#ifndef SPI_SCK_PORT
33-
#define SPI_SCK_PORT 0
33+
#define SPI_SCK_PORT 2
3434
#endif
3535
#ifndef SPI_SCK_PIN
36-
#define SPI_SCK_PIN 29
36+
#define SPI_SCK_PIN 1
3737
#endif
3838
#ifndef SPI_MOSI_PORT
39-
#define SPI_MOSI_PORT 0
39+
#define SPI_MOSI_PORT 2
4040
#endif
4141
#ifndef SPI_MOSI_PIN
42-
#define SPI_MOSI_PIN 28
42+
#define SPI_MOSI_PIN 2
4343
#endif
4444
#ifndef SPI_MISO_PORT
45-
#define SPI_MISO_PORT 0
45+
#define SPI_MISO_PORT 2
4646
#endif
4747
#ifndef SPI_MISO_PIN
48-
#define SPI_MISO_PIN 27
48+
#define SPI_MISO_PIN 4
4949
#endif
5050

5151
#ifndef SPI_CS_TPM

test-app/app_nrf54l.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ void WEAKFUNCTION RAMFUNCTION arch_reboot(void)
3434
AIRCR = AIRCR_SYSRESETREQ | AIRCR_VKEY;
3535
while(1)
3636
;
37-
wolfBoot_panic();
3837

3938
}
4039
#endif

0 commit comments

Comments
 (0)