net+os 6 bsp how and why it was restructured changes to memory map new features how to port to...
TRANSCRIPT
![Page 1: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/1.jpg)
NET+OS 6 BSP
• How and why it was restructured• Changes to memory map• New features• How to port to custom hardware
![Page 2: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/2.jpg)
BSP Structuring
• Files broken up into S/W common to all platforms and S/W specific to a particular board
• Common files in src/netos/common• Platform specific files in subdirectories in
src/netos/platforms• ARM7 init code in src/netos/arm7init• Platform specific code simply since each set
only supports a single platform
![Page 3: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/3.jpg)
Supported Platforms
• ns7520_a: NS7520 development board• net50_d: Old style NET-50 rev D board• net50bga_a: Current NET-50 BGA board
![Page 4: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/4.jpg)
Building a BSP
• Build from netos/src/bsp directory• In GNU platform specified in command line
to make file– make PLATFORM=net50bga_a
• In GHS platform specified by picking platform specific build file– Build net50bga.bld
![Page 5: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/5.jpg)
Customizable Linker Scripts
• Linker scripts determine memory layout• NET+OS 5 had linker scripts for each
application• NET+OS 5.1 had one set of linker scripts• NET+OS 6 has one set of linker scripts for
each platform• Items likely to be changed are in one file for
easy customization
![Page 6: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/6.jpg)
More Efficient Memory Layout
• Earlier versions of NET+OS wasted most of memory
• Half was given to data, the other half to code• Heap was fixed size• NET+OS 6 packs code and data together so
that memory is not wasted• NET+OS 6 heap is automatically given all
unused memory
![Page 7: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/7.jpg)
Watchdog Driver
• Watchdog resets unit if it locks up• Driver supports internal watchdog and TI
TPS382X and MAXIM MAX6316-MAX6322
• Beware that watchdog must not be turned on while in debugger
![Page 8: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/8.jpg)
UDP Debug Driver
• New driver that makes printf output available over the network
• Useful for debugging if application H/W does not have any extra serial ports
• Output displayed on PC using UDPDB program supplied with NET+OS 6
![Page 9: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/9.jpg)
Other New Features
• Simple serial driver for debugging BSP before real serial driver has been initialized
• Debug version of BSP that has asserts and extra printfs
• Ethernet MAC address is now stored in NVRAM
• 9 character serial numbers
![Page 10: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/10.jpg)
Features….
• Customers can change BSP_TICKS_PER_SECOND
• Ethernet driver has transmitter lockup recovery code
• Bootloader DHCP will generate XIDs based on Ethernet MAC addressed to avoid collisions with other units
![Page 11: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/11.jpg)
Porting BSP to Customer H/W
• Step 1: Create a new platform directory– Copy a platform subdirectory similar to
customer H/W– Give it an appropriate name
• Step 2: Edit configuration files bsp.h and bsp.c– Select device drivers, NVRAM type, system
clock speed, and SYSCLK source– NS7520 development board uses external
oscillator
![Page 12: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/12.jpg)
Porting BSP to Customer H/W
• Step 3: Create new build files or update the make file– GHS: Create project build file in bsp directory– GHS: Update bsp.bld and subproject.bld files in
new platform directory– GNU: Update makefile in bsp directory
![Page 13: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/13.jpg)
Porting BSP to Customer H/W
• Step 4: Update the linker scripts– Edit customize.lx or customize.ldr– Set flash size for file system– Set size of flash and RAM– Set Maximum size of application image
![Page 14: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/14.jpg)
Porting BSP to Customer H/W
• Step 5: Update cs.c and gpio.c– cs.c controls how chip selects are setup– Default code sets up CS0 for flash and CS1 and
CS2 for RAM– gpio.c sets up GPIO ports and LED driver
• Step 6: Update NVRAM structure– Confusion in the field– Customers should update NVRAM structure to
suite their application
![Page 15: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/15.jpg)
Porting BSP to Customer H/W
• Step 7: Update error and exception handlers– Error handler called for fatal errors and blinks
LEDs– Exception handler called for all unexpected
exceptions and also blinks the LEDs– Can be configured to reset through bsp.h– Or modify as needed by the application
![Page 16: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/16.jpg)
Porting BSP to Customer H/W
• Step 8: Create Debugger Scripts– Copy one of our scripts– Modify it for customer H/W memory setup
• Step 9: Debug in RAM– Verify H/W setup correctly by debugger script– Step through init.s and ncc_init.c
![Page 17: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/17.jpg)
Porting BSP to Customer H/W
• Step 10: Debug in ROM– Verify processor bootstrap settings– Step through init.s and ncc_init.c– Verify that chip selects and GPIO are setup
• Step 11: Modify Startup Dialog– Usually customers have no need of it and it can
be removed
![Page 18: NET+OS 6 BSP How and why it was restructured Changes to memory map New features How to port to custom hardware](https://reader035.vdocument.in/reader035/viewer/2022071807/56649e4c5503460f94b41eba/html5/thumbnails/18.jpg)
Porting BSP to Customer H/W
• Step 12: Update the POST– Add tests for application H/W
• Step 13: Update ACE– ACE has a setup of callbacks for important
events– Determine what to do if DHCP loses IP address
(default behavior is to reset the unit)– Determine what to do if Auto-IP address is not
routable (Auto-IP addresses are not routable)