VNC2 Web Training - Software (Part Two)

Views:
 
     
 

Presentation Description

Introduction to the Vinculum II software development Tools and firmware development model.

Comments

Presentation Transcript

Slide 1: 

Vinculum II (VNC2) Firmware Development Training

Agenda : 

Agenda Firmware Development Model Software Programming Tools How to build an application on the VNC2 Precompiled Firmwares Summary

Firmware Overview : 

Firmware Overview VNC2 is a programmable, dual channel USB Host / Slave controller. Programmable nature of the device requires development model to make it easy for users to applications for the device. Modular approach. Firmware architecture split into 4 categories: VNC2 real-time operating system (RTOS) VNC2 device drivers. Vinculum II Tool Chain – for user application development. Precompiled Firmware (same as VNC1L). Traditional embedded systems design approach.

Slide 4: 

FTDI Supplied Content Stdlib Math Stdio User Application Device Manager File System Vinculum II Tool Suite SD Card SPI Master SPI Slave UART FIFO USB Host BOMS HID HUB CDC FT232 USB Slave Kernel Services Vinculum II Hardware Libraries Upper Level Drivers Hardware Interface Drivers VNC2:Firmware Architecture

VNC2 Firmware : 

VNC2 Firmware VNC2 RTOS Multithreaded RTOS. Responsible for scheduling, thread management, interrupt handling, application monitoring, hardware management and diagnostics. Device Manager Service to manage communications between RTOS kernel and device drivers. All communication to hardware is carried out via device drivers. Abstracts hardware interface from the user, simplifying development. User does not need to be a USB expert. Application Development ‘C’ based embedded development tools.

Software Development Tool Chain : 

Software Development Tool Chain Vinculum II Chip VinIDE Firmware & Libraries Tool chain

Integrated Development Environment : 

Integrated Development Environment Provides the environment to develop Vinculum II-based applications Easy-to-use GUI based environment, incorporates ability to edit, build and debug projects. Command line tools available. Integrates RTOS and drivers. Has many of the features of commercial IDEs used in the industry today

VinIDE Tutorial : 

VinIDE Tutorial Video tutorial on Vinculum II Tool suite at following link:

Software Development Flow : 

Typical development flow: Software Development Flow IDE *.asm file *.obj file *.bin/*.rom file COMPILER Assembler Linker Debugger V2CL

Contents : 

Contents Vinculum II (VNC2) Chip VNC2 Programming Tools How to build an application on the VNC2 Application Examples Summary

Application Programming on VNC2 : 

Application Programming on VNC2 1. Initialisation section Kernel initialisation Driver initialisation I/O configuration Thread creation Start scheduler 2. Thread execution section Driver management I/O transfers Processing VNC2 applications are made up of two parts:

Initialisation : 

Initialisation Start Execution Setup I/O Configuration Declare Threads Start Scheduler / RTOS Start Setup clock freq, scheduler freq, no of devices. Declare drivers to be used eg UART/USB/BOMs drivers. Setup IOMUX routing Declare user processing threads

Thread Execution : 

Thread Execution Return/ Loop Open Driver Handles Thread called Carry out user processing Scheduler will periodically monitor execution and task priority. If higher priority process appears, scheduler will stall current task and switch execution By storing the scheduler will store details on current task.

Program Example : 

Program Example void main(void) { usbhost_context_t usb_ctx; gpio_context_t gpioCtx; // Initialise kernel vos_init(10, VOS_TICK_INTERVAL, NUMBER_OF_DEVICES); vos_set_clock_frequency(VOS_48MHZ_CLOCK_FREQUENCY); // Initialise IOMUX parameters vos_iomux_define_output(12,IOMUX_OUT_GPIO_PORT_A_1); vos_iomux_define_output(13,IOMUX_OUT_GPIO_PORT_A_2); vos_iomux_define_output(29,IOMUX_OUT_GPIO_PORT_A_5); vos_iomux_define_output(31,IOMUX_OUT_GPIO_PORT_A_6); //Initialise drivers // use a max of 4 USB devices usb_ctx.if_count = 4; usbhost_init(-1, VOS_DEV_USB_HOST, &usb_ctx); boms_init(VOS_DEV_BOMS); fatdrv_init(VOS_DEV_FAT); gpioCtx.port_identifier = GPIO_PORT_A; gpio_init(VOS_DEV_GPIO,&gpioCtx); // Declare thread called tcbFirmware in function firmware() tcbFirmware = vos_create_thread(29, SIZEOF_FIRMWARE_TASK_MEMORY, firmware, 0); //Start RTOS and start execution of threads vos_start_scheduler(); main_loop: goto main_loop; } void firmware(void) { unsigned char connectstate; unsigned char status; usbhost_device_handle *ifDev; // USB host variables usbhost_ioctl_cb_t hc_iocb; usbhost_ioctl_cb_class_t hc_iocb_class; msi_ioctl_cb_t boms_iocb; // BOMS device variables boms_ioctl_cb_attach_t boms_att; fat_ioctl_cb_t fat_ioctl; // FAT file system variables fatdrv_ioctl_cb_attach_t fat_att; FILE *file; gpio_ioctl_cb_t gpio_iocb; // GPIO variables unsigned char leds; // open host controller handle hUsb = vos_dev_open(VOS_DEV_USB_HOST); // open GPIO device handle hGpio = vos_dev_open(VOS_DEV_GPIO); gpio_iocb.ioctl_code = VOS_IOCTL_GPIO_SET_MASK; gpio_iocb.value = 0xff; // set all as output vos_dev_ioctl(hGpio, &gpio_iocb); do { //Main processing code occurs in a loop vos_delay_msecs(250); leds = LED0; vos_dev_write(hGpio,&leds,1,NULL); vos_delay_msecs(250); leds = 0; vos_dev_write(hGpio,&leds,1,NULL); ………… Initialisation Code Thread Processing Code

Pre-compiled Firmware : 

Pre-compiled Firmware Range of VNC1L style firmware images will be released for VNC2. V2DAP: Disk and peripherals. Available V2DPS: Disk, printer and slave interface support. Available V2MUSIC: planned Firmware will be supplied as a full source project as an application example. Large range of examples available with installer. GPS Logger Digital camera capture USB Host USB Slave Multithread processing example HID class examples

Plugins – IOMux Utility : 

Plugins – IOMux Utility Software utility for setting device IOMux configuration. Graphical interface provides easy configuration. Utility generates IOMux code for user software program.

Summary : 

VNC2 programmable USB Host / Slave controller, allows the device to be used in a wide range of applications. Firmware development resources are designed to simplify application development for the VNC2. RTOS: Device management and scheduling functions. Device drivers: Abstract hardware interface, providing easy access. Development tools: Easy to use programming environment Precompiled firmware: ready-to-use application environment VNC2 is a powerful, easy-to-use complete solution offering, low risk and faster time to market Summary

Summary : 

Software development tools available to download free of charge from www.ftdichip.com Large number of reference examples and application notes. Summary

Slide 19: 

19 Thank You