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

Compare with Current View Page History

« Previous Version 8 Next »


    

Introduction

  • This document  describes the bring-up of RdkFwUpgradeManager in RPI RDK Broadband devices for firmware upgrade by using HTTP protocol.
  • Downloaded firmware from local/public http server with support of http protocol.

Build procedure to generate R-Pi image with Firmware upgrade

Please refer the below link for host environment set-up & flashing procedure for yocto build ,

Dunfell :

RPI 3B/3B+ Model Reference Platform

Morty:

RDK-B Raspberrypi - Host SetUp and Build Instructions#BRaspberrypi-HostSetUpandBuildInstructions-YoctoBuildSteps

Repo Steps

To  build, follow below instructions


    Dunfell Build
    $ mkdir <workspace dir>
    $ cd <workspace dir> 
    $ repo init -u https://code.rdkcentral.com/r/manifests -b dunfell -m rdkb-extsrc.xml 
    $ repo sync -j`nproc` --no-clone-bundle
    Morty Build
    $ mkdir <workspace dir>
    $ cd <workspace dir> 
    $ repo init -u https://code.rdkcentral.com/r/manifests -b rdk-next -m rdkb-extsrc.xml 
    $ repo sync -j`nproc` --no-clone-bundle

    FwUpgradeManager generic changes,

    FwUpgradeManager
    $cd ~/rdk/components/generic/rdk_logger
    git fetch https://code.rdkcentral.com/r/rdk/components/generic/rdk_logger refs/changes/52/60852/1 && git cherry-pick FETCH_HEAD

    Note : The above bug fixes changes are temporary given as instructions. This is not required once the change is gets merged into the appropriate repo.

    Image Generation Steps


    Build steps
    $ MACHINE=raspberrypi-rdk-broadband source meta-cmf-raspberrypi/setup-environment
    $ bitbake rdk-generic-broadband-image

    Overall Architecture

    Following diagram depicts the flow of control among the components,

    FwUpgradeManager

    TR-181 Data Model Parameters 


    S.NODMValueDescription
    1Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURLhttp://192.168.0.8 Value should be local/public http server url
    2Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadProtocolhttpValue should be auto-generated based on above parameter Input
    3Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownloadrdkb-generic-broadband-image_rdk-next_20210525055548.rootfs.wicValue should be Firmware Image Name .

    Note: This API does not reboot the device.

    4Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadStatusCompletedReturns the current state of the Firmware Download operation.
    5Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadNowTrue 

    Downloads and upgrades the firmware. The firmware is updated in the passive bank and marks it as active.

    Reboots the device and the device boots up with the active bank and updated firmware.


    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:

    bzip2 -d <path to ImageName.wic.bz2>
    $ sudo -E bmaptool copy --nobmap <path to ImageName.wic> <path to SD card space>


    Ex:


    $ bzip2 -d rdk-generic-broadband-image-raspberrypi-rdk-broadband.wic.bz2
    $ sudo -E bmaptool copy --nobmap rdk-generic-broadband-image-raspberrypi-rdk-broadband.wic /dev/sdb


    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

    Increasing the rootfs partition size in SD-CARD if Flashed for first time

    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 gparted ui 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

    Local Apache2 server set up

    Server Set-up 

    1.  Install the apache2 http server in local pc
    2.  place the rpi image in document root directory.

    HTTP Location folder

    Verify that rpi image file  is present in the http folder. Here , document root directory as "/var/www/html"

    Local Http server Document root path
    keerthana@keerthana-INVALID:/var/www/html$ pwd
    /var/www/html
    keerthana@keerthana-INVALID:/var/www/html$ ls -lh rdkb-generic-broadband-image_rdk-next_20210813104338.rootfs.wic
    -rw-r--r-- 1 root root 316M Aug 13 17:29 rdkb-generic-broadband-image_rdk-next_20210813104338.rootfs.wic
    keerthana@keerthana-INVALID:/var/www/html$ 
    
    

    Execution steps

           Please run the below commands for FwUpgrade Manager,

    Before Executing of FwUpgrade Manager commands,

    Before Execution Steps
    root@RaspberryPi-Gateway:~# dmcli eRT getv Device.DeviceInfo.                                     
    CR component name is: eRT.com.cisco.spvtg.ccsp.CR
    subsystem_prefix eRT.
    getv from/to component(eRT.com.cisco.spvtg.ccsp.fwupgrademanager): Device.DeviceInfo.
    Execution succeed.
    Parameter    1 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadStatus
                   type:     string,    value: Not Started 
    Parameter    2 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadProtocol
                   type:     string,    value:  
    Parameter    3 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadURL
                   type:     string,    value:  
    Parameter    4 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareToDownload
                   type:     string,    value:  
    Parameter    5 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadNow
                   type:       bool,    value: false 
    Parameter    6 name: Device.DeviceInfo.X_RDKCENTRAL-COM_FirmwareDownloadAndFactoryReset
                   type:        int,    value: 0 
    Parameter    7 name: Device.DeviceInfo.X_RDKCENTRAL-COM_xOpsDeviceMgmt.RPC.DeferFWDownloadReboot
                   type:       uint,    value: 290 
    
    



    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. Verify the image version ( cat /version.txt) displays the flashed image version
    4. Verify FwUpgradeManagerLog.txt file is generated in /rdklogs/logs directory.
    5. Verify the http download is happening by noticing the change of file size using below command : cd /firmware/imagedwld ls -lh(use this command frequently to verify the file size change)
    6. Once image download completed, the Rpi board will auto reboot and come up with downloaded image
    7.  Verify the version of booted image which shows the downloaded image version

    TroubleShooting


    1. check the status of RdkFwUpgradeManager service by using the below command,
      1.  systemctl status RdkFwUpgradeManager.service
    2. Check the RdkFwUpgradeManager logs in below path,
      1. cat /rdklogs/logs/FwUpgradeManagerLog.*



    • No labels