McuOnEclipse Components: 31-July-2016 Release

Time for a new major update of the McuOnEclipse components, with the fillowing main features and changes:

  • FatFS component updated to R0.12 with patch 3 and exFAT support
  • Extended support for Cortex-M7
  • Extended support for Kinetis SDK V2.0
  • USB component support for Kinetis SDK V1.3
  • Improved FreeRTOS for NXP FreeRTOS TAD plugin
  • Added C++ wrappers to multiple components
  • Many smaller fixes and improvements

    SourceForge

    SourceForge

FatFS

It comes now with support for exFAT which removes the 4 GB file size limit of FAT32 (see http://www.howtogeek.com/235596/whats-the-difference-between-fat32-exfat-and-ntfs/).

FatFS R0.12

FatFS R0.12

With R0.12, several new API functions are now supported:

  • f_expand()
  • f_setlabel()
  • f_getlabel()
  • f_findfirst(), f_findnext()

Additionally block SPI block operation and SDHC access has been optimized, reaching typical 150 kByte write and 300 kByte read performance without DMA (depends on clock speed and SD card used).

FreeRTOS

I had several cases where the NXP FreeRTOS TAD plugin (see “Adding FreeRTOS Thread Awareness to GDB and Eclipse“) was not properly showing information, if the compiler has optimized variables so they were not accessible any more. I have patched the kernel and now it works fine as well on ARM Cortex-M7.

Cortex-M7 with FreeRTOS

Cortex-M7 with FreeRTOS

Support for Cortex-M7 has been cleaned up and extended in the FreeRTOS port, mainly with proper identification macros. The critical section handling in the CriticalSection component has been aligned with the FreeRTOS critical section handling and now properly supports interrupts.

Kinetis SDK

Several components including the KinetisTools one have been extended to be used with the Kinetis SDK. An application used with the TWR-KV58F220M (see “First steps: ARM Cortex-M7 and FreeRTOS on NXP TWR-KV58F220M“) using Kinetis SDK, FreeRTOS v9.0.0, Segger RTT, SystemView and Percepio trace is available on GitHub.

TWR-KV58F220M SDK Project

TWR-KV58F220M SDK Project

Additionally, now you can use the McuOnEclipse USB component/stack with the SDK v1.3. An example project is available on GitHub.

SDK USB Project

SDK USB Project

Summary

I hope this updates and features are useful for you. Changes are documented on GitHub. The release is available on SourceForge: https://sourceforge.net/projects/mcuoneclipse/files/PEx%20Components/

See “McuOnEclipse Releases on SourceForge” how to install the update.

Happy Updating:-)

Links

Advertisements

26 thoughts on “McuOnEclipse Components: 31-July-2016 Release

  1. Hi Erich,
    thanks for your great components!

    One remark to this article: I think you forgot to place a link in the text. Under “Kinetis SDK”: “An application used with the TWR-KV58F220M (see “xxx”) using Kinetis SDK”.
    You intended to place some link instead of XXX, didn’t you?

    Regards,
    Axel

    Like

  2. Your FAT example using PE explains in one picture the mistake NXP is making dumping PE: you can browse settings in an unfamiliar module quickly instead of reading 10 pages of manuals and typing on all the OR clauses of settings.

    Like

  3. Hi Erich,
    I have updated KDS 3.2 with these PE components but now PE returns the error “No type specified (Use Find)” in FAT_FileSystem component of an existing project based on a K20DN512. In the component panel the expected options of the “Use Find” are missing and the resulting value is -1. Do you have any suggestion on what to do?
    Thanks and best regards, Michael

    Like

  4. hi Erich,
    I need to use debug BDM freescale MCU (MC9S12C64), my equipment debugging is USBDM on the BDM port of MCU MC9S12C64.

    you know any sofware free to do this? the codewarrior so allows 32k in free version.

    or cracked.
    Student purposes only.

    thank you

    Like

    • Hi Rafaelo,
      I have not used USBDM with S12 devices, so I cannot help much on this. CodeWarrior for sure is a good option, but here I recommend to use the P&E Multilink, but it is not free.

      Erich

      Like

  5. Hi Erich, how are you, i install this componets in kd3.0 and show me some warnings like:

    Generator: Warning: at line 135: {{DEVELOPMENT}} The symbol “SaveSymbol__REG_INIT_ONLY__” is not described in the header/comment and is not undefined at the end of included file. (file: Drivers\Kinetis\Static_FTFx_FlashConfig.prg) Cpu Processor Expert Problem

    what that means?

    Thank you for your work around mcu 🙂

    Like

    • Hi Marcela,
      have you turned on the Processor Expert debug mode? Go to Window > Preferences > Processor Expert > Component Development and check if “Enable Processor Expert Components Debug Verbose Mode” is *disabled”?
      I hope this helps,
      Erich

      Like

  6. Erich,

    Thanks for all the work. It is really helpful!
    Is there a USB TMS (test and measurement class) support with the K64F freedom board?

    Weimin

    Like

  7. Hi Erich, thank you for the regular updates and the helpfull components, I use them in many projects.
    I think I found a copy past error in Kinetis Tools Components in routine UIDGet. The code is :
    uid->id[4] = (SIM_UIDML>>24)&0xff;
    uid->id[5] = (SIM_UIDML>>16)&0xff;
    uid->id[6] = (SIM_UIDMH>>8)&0xff;
    uid->id[7] = SIM_UIDMH&0xff;

    but should be:
    uid->id[4] = (SIM_UIDMH>>24)&0xff;
    uid->id[5] = (SIM_UIDMH>>16)&0xff;
    uid->id[6] = (SIM_UIDMH>>8)&0xff;
    uid->id[7] = SIM_UIDMH&0xff;

    I think.
    best regards,
    Hans

    Like

  8. Hi Erich,

    In my application I use the PE FatFS component. To read a directory I use the component methods opendir and readdir. But what I missed is the counterpart to opendir. As a workarround I directly used f_closedir().
    For completion it would be good to have the method closedir in the FatFS component interface.

    Thanks
    Michael

    Like

  9. Hi Erich,
    Here are issues in methods FATM1_disk_read and FATM1_disk_write if we read or write more than 2 sectors (((sector_size – offset) + count to read/write) > sector_size) and address of buffer is not multiple of 4.
    Problem that if we pass into method SD_TransferBlock misaligned buffer, DMA of SDHC reads/writes by blocks of 4 bytes.
    For example:
    buffer has address 3
    we read 2050 bytes.
    first 512 bytes (sector 0) will be read from cache
    sectors 1,2 and 3 will be read thru DMA into following addresses 512, 1024 and 1536, but not 515, 1027 and 1539 as we expected
    sector 4 will be read into cache and the rest 2 bytes will be read into address 2051.
    i used intermediate buffer to read/write from/to files.

    my version of these functions:
    DRESULT FATM1_disk_read(uint8_t drv, /* Physical drive number (0..) */
    uint8_t* buff, /* Data buffer to store read data */
    uint32_t sector, /* Sector address (LBA) */
    uint8_t count /* Number of sectors to read (1..255) */
    )
    {
    (void)drv; /* not used */
    if (!count)
    return RES_PARERR;

    if (Stat & STA_NOINIT)
    return RES_NOTRDY;

    uint8_t* buf = buff;
    bool misaligned = (size_t)buff % 4;
    if (misaligned)
    buf = (uint8_t*)malloc(FATM1_BLOCK_SIZE);

    if (!buf)
    return RES_NOT_ENOUGH_CORE;
    do
    {
    if (SD_TransferBlock(&SD, TRUE, sector * FATM1_BLOCK_SIZE, buf))
    break;
    if (misaligned)
    {
    memcpy(buff, buf, FATM1_BLOCK_SIZE);
    buff += FATM1_BLOCK_SIZE;
    }
    else
    buf += FATM1_BLOCK_SIZE;
    sector++;
    } while (–count);
    if (misaligned)
    free(buf);
    return count ? RES_ERROR : RES_OK;
    }

    const uint8_t* buff, /* Data to be written */
    uint32_t sector, /* Sector address (LBA) */
    uint8_t count /* Number of sectors to write (1..255) */
    )
    {
    (void)drv; /* not used */
    if (!count)
    return RES_PARERR;
    if (Stat & STA_NOINIT)
    return RES_NOTRDY;
    if (Stat & STA_PROTECT)
    return RES_WRPRT;

    uint8_t* buf = (uint8_t*)buff;
    bool misaligned = (size_t)buff % 4;
    if (misaligned)
    buf = (uint8_t*)malloc(FATM1_BLOCK_SIZE);

    if (!buf)
    return RES_NOT_ENOUGH_CORE;

    do
    {
    if (misaligned)
    memcpy(buf, buff, FATM1_BLOCK_SIZE);

    if (SD_TransferBlock(&SD, FALSE, sector * FATM1_BLOCK_SIZE, buf))
    break;

    if (misaligned)
    buff += FATM1_BLOCK_SIZE;
    else
    buf += FATM1_BLOCK_SIZE;
    sector++;
    } while (–count);
    if (misaligned)
    free(buf);
    return count ? RES_ERROR : RES_OK;
    }

    If you have better solution, I’d glad to use it

    Best regards, George.

    Like

      • Hi Erich
        Of course, my buffer is aligned by 4. But sometimes I need to read chunk of file into middle of that buffer.
        For example I have buffer I use for sending/receiving file to/from server. So it has header, for example 3 bytes (chunk number and other stuff). Right after header goes data from file.
        I read file into that buffer like f_read(fp, &buffer[3], bytesToRead, &bytesRead)
        Same with writing. I got data from server. Header’s length is 3 bytes and followed by file data. Then i write like f_write(fp, &buffer[3], bytesToWrite, &bytesWritten)
        As you can see i have to use intermediate buffer to workaround this bug of SD’s DMA.

        Like

  10. there’s in WAIT component WaitOsms function
    better use vTaskDelay((TickType_t)ms*configTICK_RATE_HZ/1000)
    instead of vTaskDelay(ms/portTICK_PERIOD_MS)
    if we unroll macro portTICK_PERIOD_MS we get vTaskDelay(ms/((TickType_t)1000/configTICK_RATE_HZ))
    and if configTICK_RATE_HZ is greater 1000, you’ll get zero. So multiply first, then divide

    Like

      • Oh, yes. Default definition of this macro is the same. Thank you for hint. I’ll use this macro instead of my code

        Like

      • I have started using that macro in my code too as much as possible. Still legacy code are using the ‘old’ way how FreeRTOS was used (as well in many FreeRTOS examples).

        Like

What do you think?

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s