AnsweredAssumed Answered

Adapting iNEMO v2 virtual com port, DFU code for Olimex STM32 board

Question asked by Reddy.Harinadha on May 3, 2012
Latest reply on Jul 23, 2012 by Reddy.Harinadha
Hello everyone,
I have Olimex STM32-P103 bord which has STM32F103RBT6 micro. I flashed Virtual com port DEMO .hex file from the example code they provided. With some technical support from Olimex, Windows 7 virtual com port driver is working. But the example uses very old version( v1.0) libraries. I want to use FreeRTOS for implementing my application. I also need DFU support. 

I also have STEVAL-MKI062V2  iNEMO v2 with micro STM32F103RET7. ST provided Firmware project source for IAR Embedded workbench. It has virtual com port code with DFU support. I want to utilize this code to make STM32-P103 board communicate via virtual COM port with DFU support. I'm working with IAR EW+FreeRTOS+ST-LINK+WINDOWS 7.
I created project, configured & programmed the Olimex board. But the board is not recognized on COM port. 

When i DEBUG & see, the debugger stuck in the while loop shown in the code. which means something is wrong in USB related things( i guess clock configuration & driver related).

 inInitTask(void *pvParameters)
    iNEMO_HW_Config(); //Configure the hardware for the iNEMO platform
    while(bDeviceState != CONFIGURED);  // THIS LOOP IS GOING INFINITE       
    iNEMO_Config(); // Initialize the iNEMO sensor platform
    Timer_Config(); // Configures the timer 2 for frequency interrupts in Hz

In adapting the iNEMO v2 code for Olimex board, i did the following.
1. Created a project & configured it to suit medium density devices in Linker option config file. Also modified Startup_stm32f10xmd.s file to suit in FreeRTOS environment as below:
        EXTERN  __iar_program_start
        EXTERN  SystemInit
        EXTERN vPortSVCHandler  ; defined for FreeRTOS
        EXTERN xPortPendSVHandler  ; defined for FreeRTOS
        EXTERN xPortSysTickHandler  ; defined for FreeRTOS
        PUBLIC  __vector_table
2. Configured DISC, push button & status LED pin of Olimex board to suit iNEMO board DISCONNECT pin of USB & push button, status LED buttons. Rest of the code of iNEMO is commented out.
3. I did not change descriptors related to USB.
I don't know where I'm wrong. I'm quite sure that my problem related clock configuration & driver. How to use the driver inemo folder so that Olimex board can be recognized by computer.

I attached working version main.c file from virtual com port example from Olimex. It uses old libraries. Is the clock configuration in this file is same as iNEMO v2 board ?
I described this problem more clearly here:</a>
Thank you.