Join GitHub today
Connecting to the serial port
You have to connect to the internal serial port to access the bootloader command line.
- Disassemble the Neufbox 5 case (there are 4 screws located under the 4 rubber pads).
- Find J11 pin header, it is located near to the USB ports. Here is the pinout, starting from the pin nearer from the PCB edge (the upper pin if the USB ports are on your right). Pins use 3.3V TTL voltage levels.
- RX (you must connect your cable TX here)
- TX (you must connect your cable RX here)
- Configure your serial port console (like picocom or minicom on UNIX, or putty on Windows) to the following baud rate :
- 115200 bit/s
- no parity
- 1 stop bit
Clone the neufbox5 branch :
git clone https://github.com/sfr-cpe/openwrt.git -b neufbox5 cd openwrt/
Configure the following items in the menuconfig :
Target System ---> (X) Cavium Networks Octeon Target Profile ---> (X) SFR Neufbox 5 Target Images ---> [*] squashfs ---> (64) Block size (in KiB)
Compile the firmware
make -j$(cat /proc/cpuinfo|grep processor|wc -l)
Warning : flashing the OpenWRT firmware will prevent your Neufbox 5 to connect to the SFR network.
Upgrade from bootloader
Default SFR firmware is not able to flash this firmware, so you have to flash the OpenWRT firmware from the bootloader on the first time.
Execute the following commands from the OpenWRT repository to put the rootfs in the /tftpboot directory :
tar -xf bin/octeon/openwrt-octeon-neufbox5-squashfs-sysupgrade.tar -C /tmp && mv /tmp/sysupgrade-neufbox5/kernel /tftpboot && mv /tmp/sysupgrade-neufbox5/root /tftpboot
Execute the following commands from U-Boot :
Flash the kernel :
tftpboot 100000 kernel; protect off 0xbec80000 0xbef7ffff; erase 0xbec80000 0xbef7ffff; cp.b $(fileaddr) 0xbec80000 $(filesize)
Flash the rootfs :
tftpboot 100000 root; protect off 0xbef80000 0xbfafffff; erase 0xbef80000 0xbfafffff; cp.b $(fileaddr) 0xbef80000 $(filesize)
To run the newly flashed firmware, you can reboot using the reset command or type run bootcmd to immediately load and start the kernel.
Upgrade from Linux
When you have flashed the firmware once from the bootloader, you can use easier ways to upgrade it.
You can either use OpenWRT sysupgrade tool to upgrade the router firmware from command line or the Luci web interface Backup/Flash Firmware page.
How to access to a button from shell code :
- Export the GPIO the button is connected to by writing the desired GPIO number to
/sys/class/gpio/gpio<GPIO number>/valuefile to get the button value. Buttons are active low, so a value of 0 tells that the button is pressed and a value of 1 tells that the button is released.
For instance, if you want to access to the WiFi button (connected to GPIO 11), execute the following command :
echo 11 > /sys/class/gpio/export
A subdirectory called
gpio11 must appear in the
/sys/class/gpio directory. You can now read
Here are all available buttons :
|Button name||GPIO number|
Service led (the RGB one) is directly connected to the SoC through GPIOs. All three leds are active low. Below are the GPIOs the leds are connected to :
Status leds (the white ones) are connected to a shift register (74HC164). The shift register is controlled by bit-banging. Below are shift register signals connection to SoC GPIOs :
|Shift register signal||GPIO number|
Status leds are connected as following to the shift register :
|Led||Shift register output|
|Internet (aka WAN)||QA|
QG and QH outputs are not connected.