Skip to content

samples: le_periph_blinky: prototype cert boot info on le_periph_blinky - #882

Draft
CijaSathish-AlifSemi wants to merge 8 commits into
alifsemi:mainfrom
CijaSathish-AlifSemi:ble_blinky_cert
Draft

samples: le_periph_blinky: prototype cert boot info on le_periph_blinky#882
CijaSathish-AlifSemi wants to merge 8 commits into
alifsemi:mainfrom
CijaSathish-AlifSemi:ble_blinky_cert

Conversation

@CijaSathish-AlifSemi

@CijaSathish-AlifSemi CijaSathish-AlifSemi commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

This is a prototype/draft to show certification ID printing at boot as requested by @kshitijvyas-Alifsemi (Not intended for merge as-is)

Short description:

  • Prints FCC, IC, NCC, and MIC cert IDs at boot using printk + SYS_INIT
  • Adds a PLAIN_BLINKY=1 build flag to skip the pm-ble snippet (for making the blinky work on le_periph_blinky
  • Adds board-specific Kconfig conf files for the three DK variants to opt in to cert printing
  • Adds a DK LED overlay to restore led0/led2 aliases after lpgpio.overlay remaps them

Build command (DK, with LED fix)

west build -b alif_b1_dk/ab1c1f4m51820ph0/rtss_he samples/bluetooth/le_periph_blinky -DPLAIN_BLINKY=1 -p always

Known limitations (what's not right here)

  1. Cert info lives in the app, not the board. Ideally this belongs at the board or subsystem level so it shows up regardless of which app is running. Putting it in le_periph_blinky means every other app has to duplicate it.

  2. SYS_INIT at PRE_KERNEL_2 doesn't guarantee clean output ordering. UART output is DMA-backed on this platform; deferred log messages can interleave with the printk box. There's no clean fix without reworking the logging init order.

  3. PLAIN_BLINKY=1 is a workaround, not a fix. The real issue is pm-ble enabling CONFIG_PM_DEVICE=y, which suspends gpio4 between BLE connection events and causes gpio_pin_set_dt to fail silently. The right fix is proper PM suspend/resume handling for gpio4 in the pm-ble snippet or the GPIO driver.

  4. Cert values are hardcoded in board conf files. No validation that the IDs are correct/current. If cert IDs ever change these files need manual updates.

Please use this as a reference for printing certification info on boot - for any Zephyr app that is built for B1.

Add -DPLAIN_BLINKY=1 build flag to skip the pm-ble snippet and
lpgpio.overlay. Without it, pm-ble suspends gpio4 between BLE
connection events, silently breaking LED GPIO writes.

When pm-ble is active, append a DK-specific overlay after lpgpio.overlay
to restore led0/led2 aliases to the gpio4 RGB LED nodes (lpgpio.overlay
remaps them to LPGPIO which is not wired to any visible LED on DK).

Defer led0 writes to a work item so they run in thread context after
device resumption, consistent with how led2 is handled.

Also add cert boot info print and suppress pm_device log noise for DK.

Signed-off-by: Cija Sathishkumar <cija.sathishkumar@alifsemi.com>
Add NCC (CCAM26LP1230T0) and JP (R 201-260499) cert IDs to all three
DK board config files.

Signed-off-by: Cija Sathishkumar <cija.sathishkumar@alifsemi.com>
Use "NCC ID" and "MIC ID" instead of "NCC" and "JP" to match
the labels as they appear on the certification marks.

Signed-off-by: Cija Sathishkumar <cija.sathishkumar@alifsemi.com>
@CijaSathish-AlifSemi CijaSathish-AlifSemi changed the title samples: le_periph_blinky: prototype cert boot info and LED GPIO fix samples: le_periph_blinky: prototype cert boot info on le_periph_blinky Jul 30, 2026
@CijaSathish-AlifSemi CijaSathish-AlifSemi added the do not merge Work in progress label Aug 3, 2026
… GPIO

button_update_handler toggled char0_val on every press edge and ignored
release, so the notified button state didn't match the physical button
and required two presses to cycle back to 0. Mirror the live GPIO level
instead so the characteristic reflects pressed/released in real time.

Signed-off-by: Cija Sathishkumar <cija.sathishkumar@alifsemi.com>
VeijoPesonen
VeijoPesonen previously approved these changes Aug 7, 2026

@VeijoPesonen VeijoPesonen left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just drop the two unnecessary overlay files and this is ok.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chips used with the Balletto devkits are not wounded down so this variant does not need to be supported.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Chips used with the Balletto devkits are not wounded down so this variant does not need to be supported.

Add board conf for alif_b1_sk_ab1c1f4m51820ph0_rtss_he with
FCC, IC, NCC and MIC cert IDs for the Balletto StartKit.

Signed-off-by: Cija Sathishkumar <cija.sathishkumar@alifsemi.com>
Align the Kconfig symbol name with the printed label so both
consistently use MIC instead of JP.

Signed-off-by: Cija Sathishkumar <cija.sathishkumar@alifsemi.com>
SW2 (PB_SW1) on B1 SK is wired to P15_0, not P15_1. Add pinctrl
pull-up and route button0 to lpgpio 0 with GPIO_ACTIVE_LOW.

Signed-off-by: Cija Sathishkumar <cija.sathishkumar@alifsemi.com>
With GPIO_ACTIVE_LOW, gpio_pin_get_dt already returns 1 when pressed
and 0 when released. The previous !(button_state & 1) inverted this,
causing the notification to be 0 on press and 1 on release. Remove
the negation so the notification correctly reflects button state.

Signed-off-by: Cija Sathishkumar <cija.sathishkumar@alifsemi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do not merge Work in progress

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants