You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »


    

Introduction

  • This document  used for upgrading firmware for RPI RDK Broadband devices using XCONF server & TFTP/HTTP protocol.
  • Downloaded firmware from local/public http server with support of http protocol.
  • Also modified the firmware script with support of both protocols. If user configured http protocol support in xconf UI, On that time firmware will be downloaded by http protocol else firmware will be downloaded by tftp protocol(By default,tftp protocol will be selected).

Environment Setup

  •   Firmware scripts and systemd service files are available in RPI build by default. Also, by default systemd firmware service file was enabled.
  •   Need to configure our RPI device configuration in XCONF Server.
  •   Using systemd command to re-start the firmware service .
  •   RPI model name is ARMV7

Build procedure to generate R-Pi image with Firmware upgrade

The build procedure for broadband are as follows:

  1. repo init -u https://code.rdkcentral.com/r/manifests -b rdk-next -m rdkb-extsrc.xml
  2. repo sync -j4 --no-clone-bundle
  3. source meta-cmf-raspberrypi/setup-environment (Select option raspberrypi-rdk-broadband.conf)
  4. bitbake rdk-generic-broadband-image 

Flashing the image


sd-card size requisite

It is must to have minimal size of 8GB SD-Card for Firmware upgrade support


Command to flash the image

Generated image has to be flashed to an SD card using this command in local PC:

$ sudo dd if=<path to ImageName.rpi-sdimg> of=<path to SD card space> bs=4M

Ex:

$ sudo dd if=rdk-generic-broadband-image-raspberrypi-rdk-broadband.rpi-sdimg of=/dev/sdb bs=4M

The SD card is inserted to the Raspberry Pi board and booted to check for containers created.

The Raspberry Pi board is connected to the PC via a USB to serial converter and the logs can be checked in console or can be connected via HDMI cable to a TV and logs will be shown in the terminal

Creating checksum file

It is necessary to flash the stable image during upgrade. So checksum file has to be created for the image to be uploaded using below command

md5sum checksum creation

md5sum "<imagefile_name>.rootfs.rpi-sdimg" > imagefile_name.txt

After checksum file is created, place this file in tftp location along with actual image file which is expected by firmware upgrade script. Without which firmware upgrade wont be allowed by scripts

Creating Multi-Boot compatible SD-CARD if RDKB is Flashed for first time


If firmware upgrade is intended for multi-boot, it is necessary to have partizion size matching to  RDKB image size ( especially rootfs ). 

To make compatible, size of RDKB rootfs partition should be increased to 2 GB ( 2098 MB) from 300MB default

This resize can be achieved using gpartedui tool which should be available in host pc


gparted tool Install and usage


Please resize the rootfs partition to 2098 MB or 2GB (/dev/sdb1) accordingly from below procedure as captured in various stages

  1. Select gparted tool from menu


2. Select the rootfs partition of format ext3 for resize/move option



3. Resize the rootfs partition by giving new size image to 2098 MiB


4. After resize , position stands as below



5.After modifying size, "Apply all operations" using tick symbol in UI which displays icon as below




6. After giving "Apply icon" position stands as below



7. After resizing is completed 

8. After applying close size increased to 2 GB can be seen

 Executing System

           Using the below command to re-start the firmware service.                           

                                                                    systemctl restart swupdate.service

          Firmware logs generation path.

                                                                   cat /rdklogs/logs/swupdate.log

Setting up XCONF Server


Please follow the below procedure in xconf server for placing new firmware for upgrade to specific device and model ( RPI in this case ) as a reference:

               

 XConf Server  Configuration Set-up:

 Create Environment



Create Model



Create MAC list by entering the MAC address of RPI board


 Firmware Config

Create the Firmware Configuration by providing Firmware Description, File name as Image name to be downloaded from Xconf server, and version is the same image name without the extension (.rootfs.rpi-sdimg) and select Model(ARMV7) form the listed Models


 Firmware Rule

Create MAC rule by providing rule name, Build condition is eStbMac, choose the option IN_LIST and for next field, select the MAC list created for RPi board, verify that based on the MAC list selection, Firmware Config will be automatically displayed under Action section.

Download Location Round Robin Filter
With selection of HTTP Protocol

Server Set-up :

  1. Install the apache2 http server in local pc
  2.  Add the below line in /etc/hosts (192.168.0.107(wan IP) http://www.myfirmware.com)
  3.  place the rpi image and checksum files in document root directory.

XCONF side :

1.Select Download Location filter under the firmware tab in XCONF UI
2.click the edit button
3.Enter the "Location (FQDN)" field is local/Public http server (fully qualified domain name ) (ex : www.myfirmware.com)
4.Enter the "Location (full URL)" field is full location path of local/Public http server (ex : http://www.myfirmware.com)
5.Unclick the check box of Never use HTTP
6. Removed the model name from Rogue Models.
7.Removed the firmware version (If it's not updated earlier, please ignore this step).
8. click the save button.

RPI Target :


9.In DUT, please edit the following file with below format,If it's local http server
i) Open the /etc/hosts
ii) Add your local http server ip with DNS ( Ex : 192.168.0.128 www.myfirmware.com)
iii) Save the file.

Note : Every reboot, You need to add the above three steps if it's local http server.






JSON Output

Verify that XConf Server configuration displays the Json response from the mentioned URL:

Using the below url to view the JSON Format result of http protocol ,
http://35.155.171.121:9092//xconf/swu/stb?eStbMac=<RPI MAC ADDRESS>&model=<model_name>&capabilities=RCDL&capabilities=supportsFullHttpUrl


With Selection of TFTP Protocol

1. Select Download Location filter under the firmware tab in XCONF UI

2. Click the edit button

3. Added the model name under the Rogue Model .

4. Click the save button.


JSON Output

Verify that XConf Server configuration displays the Json response from the mentioned URL:

Using the below url to view the JSON Format result of http protocol ,
http://35.155.171.121:9092//xconf/swu/stb?eStbMac=<RPI MAC ADDRESS>&model=<model_name>&capabilities=RCDL&capabilities=supportsFullHttpUrl

HTTP Location folder

Verify that image file and its respective md5 checksum file is present in the http folder:

keerthana@keerthana-INVALID:/var/www/html$ ls
rdkb-generic-broadband-image_default_20200529140558.rootfs.rpi-sdimg
folder rdkb-generic-broadband-image_default_20200529140558.txt


RPi - Board

  1. Flash the RDKB image supported for Firmware upgrade feature in the Rpi and verify the 2 partitions(ex. mmcblk0p1, mmcblk0p2) present under dev folder (use command ls /dev)
  2. Device auto-reboots and verify there are 2 more additional partitions are created (ex. mmcblk0p3, mmcblk0p4).
  3. Open /etc/include.properties file and verify the CLOUDURL parameter where XConf Server URL is configured
  4. Verify the image version ( cat /version.txt) displays the flashed image version
  5. Open /rdklogs/logs/swupdate.log to verify the communication from RPI board with XConf Server and the download status
  6. Verify the tftp download is happening by noticing the change of file size using below command:cd /extblock/tftpimage/imagedwnldls -lh  (use this command frequently to verify the file size change) if tftp protocol was selected in XCONF UI
  7. Verify the http download is happening by noticing the change of file size using below command : cd /extblock/httpimage/imagedwnldls -lh(use this command frequently to verify the file size change)if http protocol was selected in XCONF UI
  8. Once image download completed, the Rpi board will auto reboot and come up with downloaded image
  9.  Verify the version of booted image which shows the downloaded image version

TroubleShooting

  1.  If output.json will not be generated in /nvram folder. Please check the network connection in RPI Device.
  2. Also, check the status of swupdate service by using the below command,
    1.  systemctl status swupdate.service
  3. Check the swupdate logs in below path,
    1. cat /rdklogs/logs/swupdate.log

Conclusion

Please find the summary on firmware upgrade explained above

  • Build the image ( RDKB ).
  • Ensure 8GB sd-card is available for flashing
  • Flash the build image to sd-card
  • If Firmware upgrade is targeted for multi boot and RDKB image is flashed for the first time follow resize procedure
  • Setup xconf server ready with rules and download location for RPI device
  • Place the new image in xconf server
  • Boot the flashed image

Note : 1. RPI will go for reboot while booting for the first time, since two more partition needs to be created which requires reboot. Depends on the image present in xconf and RPI, further reboot will happen for upgrade. Please refer to design (RDKB RPI Firmware Upgrade with support of HTTP protocol - Design - 2020 M6) for how firmware upgrade works with bank switching

2. SD card should be zero filled formatted before starting the firmware upgrade procedure. DriveWipe software is used for this. Please refer the you-tube video link for the SD card full format process.

https://youtu.be/CZhsVBEMYuk

3. If the user wants to view swupdate.log file then follow below steps:
    a) Disable log rotation feature - This wipes out the log file if size exceeds after 1min
        For B image  command - systemctl disable rdkbLogMonitor
       
   b) Reboot the box - This will make swupdate.service restart and user can start getting swupdate.log for B image

4. Broadband(size 292MB) image takes roughly 20 min time from Cloud server(Xconf).

5. Minimum extended partition should be 1GB, to verify firmware feature.


  • No labels