Пример #1
0
/*---------------------------------------------------------------------------*
 * Routine:  uEZPlatformStartup
 *---------------------------------------------------------------------------*
 * Description:
 *      When uEZ starts, a special Startup task is created and called.
 *      This task brings up the all the hardware, reports any problems,
 *      starts the main task, and then exits.
 *---------------------------------------------------------------------------*/
TUInt32 uEZPlatformStartup(T_uezTask aMyTask, void *aParameters)
{
#if FREERTOS_PLUS_TRACE //LPC1788 only as of uEZ v2.04
    TUInt32 traceAddressInMemory = 0;
#endif

    UEZPlatform_Standard_Require();
#if (SIMPLEUI_DOUBLE_SIZED_ICONS)
    SUIInitialize(ETrue, EFalse, EFalse);
#else
    SUIInitialize(EFalse, EFalse, EFalse);
#endif

    // USB Flash drive needed?
    UEZPlatform_USBHost_PortA_Require();
    UEZPlatform_USBFlash_Drive_Require(0);

    // USB Device needed?
    UEZPlatform_USBDevice_Require();

    // SDCard needed?
    UEZPlatform_SDCard_Drive_Require(1);

    // Network needed?
#if UEZ_ENABLE_WIRED_NETWORK
    UEZPlatform_WiredNetwork0_Require();
#endif

#if UEZ_ENABLE_WIRELESS_NETWORK
#if UEZ_WIRELESS_PROGRAM_MODE
    UEZPlatform_WiFiProgramMode();
#endif
    UEZPlatform_WirelessNetwork0_Require();
#endif

#if ENABLE_UEZ_BUTTON
    UEZPlatform_Keypad_Require();
#endif

#if FREERTOS_PLUS_TRACE //LPC1788 only as of uEZ v2.04
    uiTraceStart();
    vTraceStartStatusMonitor();

    traceAddressInMemory = (TUInt32)vTraceGetTraceBuffer();
    printf("%x", traceAddressInMemory);
#endif

    // Create a main task (not running yet)
    UEZTaskCreate((T_uezTaskFunction)MainTask, "Main", MAIN_TASK_STACK_SIZE, 0,
                  UEZ_PRIORITY_NORMAL, &G_mainTask);

    // Done with this task, fall out
    return 0;
}
Пример #2
0
static void vGetGDBDumpCommand(uint8_t *buf, uint16_t bufSize, uint8_t *fileName) {
  /* construct gdb command string: dump binary memory <file> <hexStartAddr> <hexEndAddr> */
  uint8_t *ptr; /* pointer to data */
  size_t len; /* size/length of data */

  ptr = (uint8_t*)vTraceGetTraceBuffer();
  len = uiTraceGetTraceBufferSize();
  Utility_strcpy(buf, bufSize, (unsigned char*)"dump binary memory ");
  Utility_strcat(buf, bufSize, fileName);
  Utility_strcat(buf, bufSize, (unsigned char*)" 0x");
  Utility_strcatNum32Hex(buf, bufSize, (uint32_t)ptr);
  Utility_strcat(buf, bufSize, (unsigned char*)" 0x");
  Utility_strcatNum32Hex(buf, bufSize, (uint32_t)(ptr+len));
}
Пример #3
0
/*---------------------------------------------------------------------------*
* Routine:  uEZPlatformStartup
*---------------------------------------------------------------------------*
* Description:
*      When uEZ starts, a special Startup task is created and called.
*      This task brings up the all the hardware, reports any problems,
*      starts the main task, and then exits.
*---------------------------------------------------------------------------*/
TUInt32 uEZPlatformStartup(T_uezTask aMyTask, void *aParameters)
{
#if FREERTOS_PLUS_TRACE //LPC1788 only as of uEZ v2.04
     TUInt32 traceAddressInMemory = 0;
#endif
     
     UEZPlatform_Standard_Require();
     UEZPlatform_Timer2_Require();
     UEZPlatform_DAC0_Require();
     SUIInitialize(SIMPLEUI_DOUBLE_SIZED_ICONS, EFalse, EFalse); // SWIM not flipped
     G_expdkDetected = UEZGUI_EXP_DK_Detect();
     
     if (G_expdkDetected) { // Add EXP_DK Features we want
#if UEZGUI_EXP_DK_FCT_TEST
     // no command console so functional test can run
     // Setup standard UART without console
     UEZGUI_EXP_DK_RS232_Require(UEZ_CONSOLE_WRITE_BUFFER_SIZE, 
                                     UEZ_CONSOLE_READ_BUFFER_SIZE);
#else
     UEZGUI_EXP_DK_I2S_Require();
#endif

#if UEZ_ENABLE_WIRED_NETWORK
          UEZGUI_EXP_DK_EMAC_Require();
#endif
          UEZGUI_EXP_DK_I2CMux_Require();
          UEZGUI_EXP_DK_Button_Require();
          UEZGUI_EXP_DK_LED_Require();
          UEZGUI_EXP_DK_LightSensor_Require();
          UEZGUI_EXP_DK_ProximitySensor_Require();
          
#if (UEZ_PROCESSOR==NXP_LPC1788)
          UEZGUI_EXP_DK_SDCard_MCI_Require(1); //currently only supported on LPC1788
#endif
          UEZGUI_EXP_DK_FullDuplex_RS485_Require(UEZ_CONSOLE_WRITE_BUFFER_SIZE,
                                                 UEZ_CONSOLE_READ_BUFFER_SIZE);
          UEZGUI_EXP_DK_CAN_Require();
          
          UEZPlatform_DAC0_Require();
          UEZPlatform_Timer2_Require(); // Needed by Video player
          UEZDACWAVConfig("Timer2");
          UEZGUI_EXP_DK_AudioMixer_Require();
     } else {          
          UEZPlatform_SDCard_Drive_Require(1);
     }
     
#if UEZ_ENABLE_USB_HOST_STACK
     #if USB_PORT_B_HOST_DETECT_ENABLED
     if (G_expdkDetected) {
          G_usbIsDevice = UEZGUI_EXP_DK_USB_Host_Port_B_Detect();
     } else {
          G_usbIsDevice = UEZPlatform_Host_Port_B_Detect();
     }
     if (G_usbIsDevice) {       // High for a device
      #if UEZ_ENABLE_USB_DEVICE_STACK
          UEZPlatform_USBDevice_Require();
      #endif
          UEZPlatform_USBHost_PortA_Require();
          UEZPlatform_USBFlash_Drive_Require(0);
     } else {                   // Low for a host
          UEZPlatform_USBHost_PortB_Require();
          UEZPlatform_USBFlash_Drive_Require(0);
     }
     #else
          #if UEZ_ENABLE_USB_DEVICE_STACK
                UEZPlatform_USBDevice_Require();
          #endif
          UEZPlatform_USBHost_PortA_Require();
          UEZPlatform_USBFlash_Drive_Require(0);
     #endif
#else 
    #if UEZ_ENABLE_USB_DEVICE_STACK
        UEZPlatform_USBDevice_Require();
    #endif
        UEZTaskDelay(500);//ensure the host task has itiilaized before continuing.
#endif
     
     // Network needed?
#if UEZ_ENABLE_WIRED_NETWORK
     UEZPlatform_WiredNetwork0_Require();
#endif
     
#if UEZ_ENABLE_WIRELESS_NETWORK
#if UEZ_WIRELESS_PROGRAM_MODE
     UEZPlatform_WiFiProgramMode();
#endif
     UEZPlatform_WirelessNetwork0_Require();
#endif
     
#if FREERTOS_PLUS_TRACE //LPC1788 only as of uEZ v2.04
     uiTraceStart();
     vTraceStartStatusMonitor();
     
     traceAddressInMemory = (TUInt32)vTraceGetTraceBuffer();
     printf("%x", traceAddressInMemory);
#endif
     
#if ENABLE_UEZ_BUTTON
     UEZPlatform_ButtonBoard_Require();
#endif
     
     // Create a main task (not running yet)
     UEZTaskCreate((T_uezTaskFunction)MainTask, "Main", MAIN_TASK_STACK_SIZE, 0,
                   UEZ_PRIORITY_NORMAL, &G_mainTask);
     
     // Done with this task, fall out
     return 0;
}