// minimal.c - for BCM63381B0 bare-metal (CFE environment) #include <stdio.h> #include <cfe_api.h> // GPIO base address - you need BCM63381 datasheet for exact address #define GPIO_BASE 0x18000000 // example only, not real #define GPIO_DIR (GPIO_BASE + 0x00) #define GPIO_DATA (GPIO_BASE + 0x08)
gpio-leds compatible = "gpio-leds"; led_power label = "power"; gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; ; ; ; bcm63381b0 firmware
void gpio_set(int on) unsigned int data = (volatile unsigned int )GPIO_DATA; if (on) data // minimal
CFE> load -raw -addr=0x80800000 minimal.bin CFE> go 0x80800000 If you want to develop a full router firmware , use OpenWrt (supports many BCM63xx chips). led_power label = "power"
int main() gpio_init(); for (int i = 0; i < 10; i++) gpio_set(1); cfe_sleep(500); // milliseconds gpio_set(0); cfe_sleep(500);
make menuconfig # select bcm63xx target and your board make -j$(nproc) Output: openwrt-bcm63381-demo-squashfs-cfe.bin (ready to flash via CFE) To really develop firmware for BCM63381B0, you legally need:
Example: a minimal C program to blink an LED via GPIO.
// minimal.c - for BCM63381B0 bare-metal (CFE environment) #include <stdio.h> #include <cfe_api.h> // GPIO base address - you need BCM63381 datasheet for exact address #define GPIO_BASE 0x18000000 // example only, not real #define GPIO_DIR (GPIO_BASE + 0x00) #define GPIO_DATA (GPIO_BASE + 0x08)
gpio-leds compatible = "gpio-leds"; led_power label = "power"; gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>; ; ; ;
void gpio_set(int on) unsigned int data = (volatile unsigned int )GPIO_DATA; if (on) data
CFE> load -raw -addr=0x80800000 minimal.bin CFE> go 0x80800000 If you want to develop a full router firmware , use OpenWrt (supports many BCM63xx chips).
int main() gpio_init(); for (int i = 0; i < 10; i++) gpio_set(1); cfe_sleep(500); // milliseconds gpio_set(0); cfe_sleep(500);
make menuconfig # select bcm63xx target and your board make -j$(nproc) Output: openwrt-bcm63381-demo-squashfs-cfe.bin (ready to flash via CFE) To really develop firmware for BCM63381B0, you legally need:
Example: a minimal C program to blink an LED via GPIO.