Requests


This page is for you! If you’d like more information about something I’ve posted about, or if there is a topic you think I should post about, please leave a comment and I’ll get right to it (as fast as my schedule permits it)!

I have started to list things in my bucket list (still ongoing).

For feature requests or bug reports on the McuOnEclipse project end Processor Expert components, you should use the GitHub issue tracking system:

1,013 thoughts on “Requests

  1. Eric,

    I have followed your guide for porting PEx to MCUXpresso as shown here: https://mcuoneclipse.com/2018/07/27/porting-processor-expert-projects-to-mcuxpresso-ide/

    I’ve tried multiple times, however, I keep running into an error something to do with the vector files. The error it describes is, “undefined reference to `__thumb_startup’ within the vectors.o resource. I am using the MK22FN256LVH12. Not quite sure why it would not be defined since when I search for its source it goes to this.

    #elif defined(__GNUC__)
    #ifdef __cplusplus
    extern “C” void __thumb_startup( void );
    #else
    extern void __thumb_startup( void );
    #endif

    Thoughts?

    Like

    • Hi Chris,
      you might have a look at https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/MCUXpresso/tinyK22/tinyK22_RoomMonitor as a reference.

      It looks like you still have __thumb_startup in Vectors_Config.h?

      ‘undefined reference’ means that the function is not defined (implemented) anywhere.
      Check that the ‘startup/startup*.c’ file is indeed compiled and linked. The entry point of the reset vector with the SDK is ResetISR() inside that startup file.
      Now the _thumb_startup() one is the startup name for KDS and usually referenced from the vectors file.
      You need to change the ‘Static_code\System\Vectors.c’ (which it seems you have found). A few lines below there is
      VECTOR_1, /* 0x01 ivINT_Initial_Program_Counter */
      which means you need to change the definition of VECTOR_1which is in Generated_Code\Vectors_Config.h

      /* Vector Address No. Pri Name Description */
      #if 0 /* original Processor Expert code */
      #define VECTOR_SP_MAIN &__SP_INIT /* 0x00 – ivINT_Initial_Stack_Pointer used by PE */
      #define VECTOR_1 (tIsrFunc)&__thumb_startup /* 0x01 – ivINT_Initial_Program_Counter used by PE */
      #else /* needed by SDK startup */
      #define VECTOR_SP_MAIN &_vStackTop /* 0x00 – ivINT_Initial_Stack_Pointer used by PE */
      #define VECTOR_1 (tIsrFunc)&ResetISR /* 0x01 – ivINT_Initial_Program_Counter used by PE */
      #endif

      I hope this helps?
      Erich

      Like

  2. Erich, Your posts are always the most helpful in filling the gaps between the theory and practice! Thank you for that. I would love if you covered the topic of end-user OS updating in the field. It looks like there may be two existing options for the IMXRT: MCUBoot/Flashloader or OpenSDA/DAP-Link (which requires a co-processor?)

    Thanks!

    Like

    • The DAP-Link (or debug port) is more for debugging and development, but not for updating systems in the field. Sure you can use it for that as well, but this requires better trained operators. The bootloader/flashloader is more intended for such an update process if you have physical access to the system. Other ways are using a network link for this.

      Like

  3. Hi Erich
    I found your blog very useful. Thank you a lot to share your experiences.
    Now i would ask you for a suggestion, maybe you are interested in writing a tutorial too.
    I’m using an iMX RT1050 EVKB with MCUxpresso.
    Everything is fine, every SDK example works fine while I run it alone.
    I tried then to build up my own application, but the same is if i try to merge up two samples to have at the same time lcdif (Rocktech part) and lwip.
    It looks like i misconfigured something, it always crash in hardfault handler routine.

    I also followed your article https://mcuoneclipse.com/2018/08/12/tutorial-open-source-embedded-gui-library-littlevgl-with-i-mx-rt1050-evk/
    Very impressive library!
    Cause your code already include freeRTOS, I managed to add ethernet there. I configured pins, includes, preprocessor, etc but no way to see it works.
    Can you help me in some way?

    Best regards,

    -Francesco-

    Like

  4. Hi Erich

    First of all thanks for the interesting website so its been one of the most useful ones for someone like me getting familiar with the Kinetis stuff. I have to learn Kinetis as I am working with a KL27 based board.

    The frustration I am having with KSDK is that the documentation shows 2016 on the website but the actual API seems to have changed and the documentation feels very sparse like its geared to someone who knows the products historically unlike ST Micro which feels a lot easier to get going with or is this just me? An example of such a change is that the SDK function GPIO_SetPinsOutput() seems to have been renamed as GPIO_PortSet() in the latest SDK downloaded from the builder and I had to read the source to figure out why my code wasnt compiling from the KDSK API documentation

    I need to get the LPUART to work and in order to do that I am not sure what clock setting to use in the LPUART_Init() function call.

    This is mostly due to the fact that its taking a lot of reading getting my head around the clocking on the device, I am starting to understand it but its heavy going and quite honestly feels like too much detail has to be understood to use the peripheral drivers. I will give kudos to NXP on the config tool as its very helpful and espscially the clock diagram helps in understanding, albeit the tool cannot do peripherals for the KL27.

    Do you have any advice on clock setup. It would be great if you could do a mini tutorial on clocking architecture in the Kinetis devices. I have used the Config Tool with MCUExpresso and have tried setting the following:

    MCGPCLK as IRC48M
    MCGIRCLK is 8Mhz

    so Core and System clocks are 48Mhzand the Bus and Flash clocks are 24Mhz and OSCERCLK and ERCLK32K as well as RTC_CLKOUT are all disabled.(all setup by the clock_config files exported from the Config Tools)

    I then call LPUART_Init() with a clock value of 8000000U and call the LPUART_EnableTx() in my main() program enter a loop and try sending a byte out continously without any activity on the other side.

    Do you have any advice?

    Like

    • Hi Peter,
      thanks, and you raise several good points and challenges I’m facing too. As for the ‘documentation’ I’m basically stick to the sources. I know it is not ideal. The thing with the GPIO_SetPinsOutput() and GPIO_PortSet() has hit me too. I have now a define in my library for the SDK version used (see https://github.com/ErichStyger/McuOnEclipseLibrary and the recent post https://mcuoneclipse.com/2019/01/27/tutorial-hd44780-display-driver-with-nxp-mcuxpresso-sdk/ where I use that library). Using that library I can keep some kind of thin abstraction layer between the SDK and the application. Best of all: I can mix and match the SDK with the NXP Processor Expert and MCUXpresso Configuration Tools :-).
      On the clocking: the Clocks Tool definitely helps, but one still has to read all the reference manual information. What I found it easier to use and understand is Processor Expert (but this is not supported for KL27). So I use it PEx for KL25Z or KL26Z and from this I apply my clock settings to the KL27Z. I have a few KL27Z boards around, but I have not used the KL27Z in an active project mainly because lack of Processor Expert support and limited RAM amount on the device (the K22F is right now what we are using a lot, but that’s a much larger MCU (and has PEx support)). Writing a tutorial for KL27Z certainly is technically doable, it is just that spare time is very limited, and I’m already struggling with getting all the material ready for the next semester…

      Like

  5. Possibly this is OT for ‘Requests’ but I respect the knowledge-base here on MCUonEclipse so I hope some advice is available.
    I’m looking for a good combination of ARM micro plus a Wifi connection. This is for a datalogging application. On the micro side I will collect data at a low rate for days or weeks, and use an SD card for storage.
    There are a number of simple Wifi solutions but all seems to use a UART or SPI connections to communicate with the host micro. I am looking for as fast as possible download, and these connections would represent a bottleneck.
    Is anyone aware of a simple Wifi solution that offers a faster connection? Many ARM micros offer a USB host or Ethernet peripherals these days, if there is something compatible with these it would be great to know about.
    Thanks, Ian

    Like

    • Hi Ian,
      I don’t think this is not OT (Off-Topic) at all.
      I have to say that all my WiFi ‘attached to micrcontroller’ projects have used UART and SPI.
      I started playing with ESP32, but not to a solid state yet. If you are not aware of ESP32, you might have a look into that device.
      You get WiFi with a microcontroller in one package. I don’t think that attaching this to USB/Ethernet ist probably not a good way.
      But just in case, as a ‘big’ solution: why not using a Raspberry Pi 3 Model B+ or similar? You get Quad Core ARM Cortex-A with SD card and WiFi 🙂

      Like

      • Thanks Erich,
        For reliability & robustness reasons I want to acquire the data using a micro (bare metal / RTOS) rather than a Linux device. The Wifi element is a convenience for the user – should the Wifi fail the logger data can be recovered manually by opening the sealed case and extracting the SD card.
        The Raspberry B+ is too big but I have seriously considered a ZeroW. Two concerns: 1) how to interface to the micro using a faster method than UART / SPI and 2) how robust these Linux devices are to power supply shutdown without corrupting their Linux install.
        Regarding ESP32 there seem to be a vast number of different carrier boards and modules available. So many that it’s hard to know where to start, and how long they’ll be around for… Maybe I just need to forget about longevity of supply and jump into some R&D…
        Thanks, Ian

        Like

  6. A quick general C question that I can’t find an answer for on the interwebs.
    I have a trace function which is basically printf with a bitmask:
    traceWrite(u32 conditionMask, char* str) {if (condition(conditionMask) printf(str);}
    There is also one for variable length:
    traceWriteF(u32 conditionMask, char* format, …) {if (condition(conditionMask) variadicstuff…;}
    But I hate having to have 2 functions, one for single, one for formatted. Does anyone know the trick to combine each of these? Somehow printf magically manages it, not sure if it’s a ‘special’ or not.
    Grateful for any help. Thanks 🙂

    Like

      • Yeah the format version of traceWrite, traceWriteF, uses varargs. I suppose what I want is to be able to do as printf does:
        printf(“a string”);
        printf(“show me %s”, theString);
        Somehow even though it uses varargs too, it deals with the single param case. My code throws an error if I use traceWriteF with a single string param.

        UPDATE: I’ve just tried compiling this again (it’s been years since I mucked with it) and now it seems to work. I don’t know what changed; perhaps a warning level?
        Looks like there is no problem after all. I’m so sorry to have wasted your time. Thanks for the response though.
        😦
        (runs and hides in cupboard…)

        Like

        • Happens to me too :-).
          One note: it is very important to include the header file for interfaces, especially for interfaces with open argument lists.
          Not following that is bad and can lead to strange things.

          Like

        • Absolutely. I elevate all warnings to errors (-Werror) which seems to enable implicit-function-declaration errors, among other things (is that what you meant?). I’d rather fight with a slightly pedantic compiler than have sloppy code come back and bite be later on.

          Like

  7. Erich,
    I’d like to get your opinion on a new problem that cropped up.
    I’ve been using the MK40DN512Z CPU for several years with Processor Expert.
    Now, NXP is discontinuing this version of the CPU and replacing it with MK40DN512.
    The old chip had Mask 4N30D and the new chip has Mask 5N22D.
    My existing code fails with the new chip (HARD FAULT) in cpu.c on the instruction that checks the mask.
    I’ve checked the Errata documents for both parts and there don’t appear to be any reasons that I cannot interchange them.
    Is there a Processor Expert solution to accepting either Mask?
    If not, how do you recommend modifying the PEx-generated code to make this work with both chips?
    Thanks,
    Greg

    Like

    • Hi Greg,
      I quickly created a project for the K40dN512Z, and I don’t see code in the CPU.c checking the CPU mask version? Did I miss it?
      I have not used the K40 for a long time: I used it at the beginning where the silicon had several issues. I was dealing with this with disabling code generation.
      So you could disable the code say for the cpu component and make your modifications as needed, and they don’t get overwritten.
      Have a look in https://mcuoneclipse.com/2012/03/23/disable-my-code-generation/

      I hope this helps,
      Erich

      Like

      • Erich,
        I thought you might enjoy what I found.
        The different mask value had nothing to do with the Hard Fault.
        Rather, CPU.c sets the RESET pin filtering values in SIM_SOUT6 for the MK40DN512ZVLL10.
        There is NO SIM_SOUT6 register in the MK40DN512VLL10.
        Thus the Hard Fault when accessing it.
        The wisdom of that change escapes me.
        Greg

        Like

        • Interesting, thanks for reporting back. I guess this is because that silicon was one of the very first and they seem to have changed that?

          Like

    • Hi Greg,
      I have not made a formal comparison. But CMSIS-RTOS is a wrapper or common API to different RTOS, and this only makes sense if I would like to use different RTOS (FreeRTOS, RTX, etc) in my applications (which I don’t intend to do). So from a user perspective it does not make sense to me. And it adds more complexity and with the wrapper it hides things, potentially not using all features. So I prefer directly to use the FreeRTOS API.
      It *does* make sense for a middleware vendor (e.g. a vendor selling a USB stack), as with this the stack could use CMSIS-RTOS to make it generic. But typically the interfaces are very thin, so it makes sense for them to use directly the FreeRTOS API or provide generic hooks (as lwIP or FatFS does) and go with it.
      I have not seen any real adoption in the market of CMSIS-RTOS except from ARM directly, maybe I’m wrong?

      Erich

      Like

  8. Vielen Dank für die schnelle Antwort.
    Damit ich einen Laser-Cut machen lassen kann, benötige ich doch sicherlich eine Datei mit den Druckvorlagen für das gewünschte Gehäuse. Gibt es für Ihr Gehäuse so eine Datei für den Laser-Cutter?

    Like

  9. Hi Eric
    I saw your comment on Rob’s Sand bot. So I followed your avatar and ended up here.
    Boy!! it looks like you are a raspberry pi pro.
    I am also busy with my sand table build. Made it through al the pitfalls because I am not a programmer but more a handy builder. Ever since I saw the sisyphus it was a dream to own one. But as you know they are soooooo expensive. Are you planning to change the software or maybe port the code to a raspberry pi? That Would be great update. Rob’s software UI is OK but not very user friendly.
    I am busy making the actual table part now with a diameter of 1200mm. Electronics and mechanics is done and working. I used larger hybrid steppers and drivers for my table. Little more expensive but very quiet. Well worth the extra.

    Like

    • Glad to see you have found me :-). I’m actually not planning to use a Raspberry Pi, but instead a ARM Cortex-M4F microcontroller. I was inspired by the Sisyphus too, and first I was considering a XY solutionn. Digging more into the topic and because I plan a round table, I found Rob’s sand bot which works in a similar way as the Sisyphus. What Hyrid steppers are you using? I just ordered normal ones, and I hope the enclosure will keep it quit.
      I plan to use Sandify (https://github.com/jeffeb3/sandify) for pattern generation.

      Like

  10. Hi Eric,
    I’m using FreeRTOS in PEx on Kinetis. We’ve started having random crashes which I’ve narrowed down to vsnprintf (def in EWL cstdio), which is used for debug outputs. I’m not sure what it does behind the scenes but it smells like a stack overflow. I’m passing it a 512b static buffer, and it still hangs printing “%02X” type strings (i.e., very short). I’m guessing it’s dynamically allocating memory somewhere and having a problem there. Do you have any comments on the use of this function, or alternative implementations that might be safer than the bundled one?
    Apologies if this way out of scope for this thread. Thanks.

    Like

      • Many thanks Erich, that makes sense. I ended up using a combination of printf-stdarg.c I found floating around the web, and using inspiration from XFormat to support the (previously missing) float support. Works well enough, doesn’t crash anymore. Happy to share the source.
        I also might look at moving away from EWL; can you help me understand why you don’t recommend it and what you’d suggest as a best alternative?
        TIA

        Like

        • I try to avoid standard libraries as much as I can because the problems you have faced. Additionally using EWL makes a project not portable to another platform, and you cannot use it for a part from a different vendor. That’s why I stick to things like newlib-nano which does not have that limitation and still is decent in its implementation.

          Like

  11. Hi Erich,
    Do you know of any Eclipse add-ons for plotting variable array contents?
    I’m currently using Codewarrior (planning to transition to MCUXpresso eventually).
    I use the DSP tools in CMSIS for the Arm Cortex-M4 and debugging is laborious. When I need to check intermediate DSP results I stop at a breakpoint, expand the array in the debugger and copy-paste the values into Excel to create a plot. Sometimes it’s thousands of values at a time.
    I’d love to be able to click on the variable name and have Eclipse produce a plot for me directly.
    Anything out there that could help simplify this task?
    Thanks,
    Greg

    Like

  12. Hi Eric,
    I’m using FreeRTOS in PEx on Kinetis. I’m trying to tracking down code from a tasks executing code it shouldn’t run (non-ui task); not as simple as looking through the code unfortunately. I’m trying to see which task a routine is being called from. I’ve found configUSE_TRACE_FACILITY but still haven’t been able to use it to find the ‘current task’. I know the task handles returned from FRTOS1_xTaskCreate so I can identify each task. Any hints you can give me to help me achieve this please? It all just seems considerably complex for something that sounds simple.
    Many thanks again for your work.

    Like

      • Thanks Erich…
        Unfortunately the production software runs with a bootloader, so it’s hard (impossible?) to do that. And I have the 128k limited version of CW so that complicates things; even if I do run the ‘debugger located’ version, it has to be severely cut back in order to fit.
        Also the code in question is called a bajillion times, and I suspect only a few times are bad.
        Not looking good for me! 😛
        Cheers

        Like

        • you could add the symbols of the bootloader in the debug session and you should be able to debug it that way with symbols.
          One idea would be (if you can change the code in question) is to check the stack frame and calling PC location: maybe there is a good set of callers, and you could check for it. If it calls from somewhere else: go into a debug routine.
          The best solution would be to use some kind of hardware trace, but that’s the most complicated setup and the hardware needs to support it.

          Like

  13. Hi Erich. A question re nonvolatile storage. We selected Kinetis (on CodeWarrior) as the long-term solution to replace ATmega MCUs some years back. There was always an option for NVM (emulated EE) for us in the family back then, but now it seems that no new variants support this. Also MCUXpresso doesn’t support those earlier models which prevents us using that tool at present.
    We are gearing up to use some other method (IIC FRAM looks promising). This may also give us a path forward using MCUXpresso.
    Do you happen to know why on-board NVM support has been dropped? What do other people do to manage this these days? I’d be interested in any other related comments and suggestions along this track. I’m guessing it’s more to do with manufacturability than demand- I’m sure the need for settings memory still exists!
    Many thanks in advance.

    Like

  14. Hi Erich,

    Love the blogs with lots of useful information for all levels of programmers.
    I have been working recently on a project requiring position indepenedent code for an A/B swappable position bootloader. The project uses an NXP S32k144 chip and some resources were already available for generating position independent code using the eclipse S32DS. NXP posted an example (https://community.nxp.com/docs/DOC-345595) but I could not get it to work for me atm. Even if I could get it to work I would like to know more surrounding the linker and global offset tables (how global variables access it etc.) and the placement of vector interrupt tables.
    I looked through the blog but could not find much on the topic unfortunately (information on the web also has not been very helpful thusfar). Is it an interesting topic for you to write about and help newcomers on this topic?

    Happy blogging.

    Kind regards,
    Sebastiaan

    Like

  15. Hi Erich, just wondering if you have looked at using Rust as an alternative to C ? It seems to have many benefits, but support from manufacturers is still lacking.

    Like

    • Hi Geoff,
      yes, I have looked into it last year, but in my view the situation has not changed: as you mention, there is a lack of tools for it, and I have not found a good way to use it in combination with C/C++. The concept of the language is appealing, but I challenge the real need for it: for me Rust is more a nice-to-have but not something really needed? I see more benefits of having MircoPython on an embedded systems in combination with C/C++.

      Like

  16. Hey Erich. I recently fought for several days on a hard fault issue that I solved with the help of your HardFault PEx component- thank you. This bug was so significant and challenging that I really wanted to share it to help yourself and other people out in future.
    The details are at the end of this thread: https://community.nxp.com/thread/315511
    Best regards.

    Like

  17. Hi Erich,
    Your site’s been an amazing help already – any chance you might try taking on the porting of the power_mode_switch_ca for the RT1052 from the EVK to the Seeed board?

    I’ve made use of your other Seeed examples – really helpful.
    Also tried the low-power port myself, but seems I’ve gotten caught up on something to do w/ the FLASH when it comes to low power modes. (Code runs from FLASH fine, but when updating clocks, FLASH dies despite keeping clock frequency in check).

    I’m a little surprised the demo doesn’t re-locate all their code to RAM… (pretty weird – as that demo SHOULD be working from the EVK’s hyperflash, though I dont have a board to verify)

    Here’s where I am on github: https://github.com/andrewrt/rt1052-power_mode_switch_ca/

    Like

    • I have not played in that area. And because there is the ‘exam season’ right now I doubt I will have a chance in the coming weeks for this anyway.
      Did you create/check the clock settings with the clocks tool? This helped me in the past to find some mistakes too.
      We have modified one of the Seeed boards with a Hyperflash device, but I don’t have access to that board right now, so I cannot check it.

      Like

      • i gotcha, and yes I have used the clock config tool, mainly aiming to keep the FLASH @ or under 133MHz where it’s spec’ed at. Perhaps there are further rules I’m missing.
        Sounds like NXP support has been able to replicate my issue w/ their EVK – shall see what they find!

        Like

  18. Hi Erich,

    I am using KDS Version 3.2.0 and I am working on a project that uses a KE02 (Cortex M0+). I am running into an issue with unaligned memory access (as you know, Cortex M0+ does not support unaligned memory access), which throws a hard fault. The unaligned access is happening for two reasons as far as I can tell: The use of packed structures and having GCC optimize for size (-Os) flag enabled.

    What is happening is that I end up needing to dereference a pointer to a 16 bit member of a packed structure. Depending on the compile, sometimes that member is aligned (placed at an even address) and sometimes that member is unaligned (placed at an odd address).

    If I access the packed structure through the dot (.) and arrow (<-) notation, GCC recognizes the potentially unaligned access and generates the appropriate instructions and all is well. But if I cast a pointer to a member in the packed structure, GCC does not seem to know about this and will try to read a half-word at an unaligned address and hard fault.

    I can work around some of these issues by using the the dot (.) and arrow (<-) notation and other tricks, but the really challenging problem is when the member in the packed structure is a pointer and either the pointer itself or the address it is pointing to is unaligned. I can't seem to find anyway to deference it without causing a hard fault.

    Any tips or tricks on how to deal with this without a big re-write? Even a re-write is challenging because it is not easy to find all the places where unaligned memory access might be happening. Version 9 of GCC added a new warning "-Waddress-of-packed-member" that would be very useful, but upgrading to a newer version of GCC isn't possible in my situation.

    Like

    • I you probably have reasons to use packed structures, but can you avoid this? Exactly for the kind of issues you describe I never us packed structures. If I have a dedicated memory layout e.g. from network packets, then I handle this ‘by hand’ in the send/receive routine.

      Like

      • We have packets coming in over LIN bus from 8-bit devices so we use packed structures to match the incoming data format. The current receiving code is in a shared module that gets compiled for a few other architectures, and those architectures are fine with unaligned memory access, so we haven’t had an issue until now.

        It sounds like a re-write is the way to go. Thanks for the reply!

        Like

        • Yes, I recommend a rewrite. I never use structs to map such data: I always receive the data in an array of bytes and then pack it into the needed structures/etc. Yes, ‘copy-less’ operation is usually what is desired, but for small data packets as they exist in LIN should not be a problem.

          Like

  19. Hi Erich, thank you for your very informative blog! I’m working on the project using a FRDM-K22F board and a sensor wired to J6 using SPI. My tools of choice are MCUXpresso family. I can communicate with the sensor using the CPU, but can not wrap my head around how to make it work via DMA. mcuxpresso SDK examples and SDK documentation are not very helpful. At this point (I think) I have a good understanding of SPI and DMA modules but how to make DMA work with SPI 4 bytes FIFO and DMA requests it generates? MCUXpress Configuration tool conveniently helps you to configure both modules (even SPI+DMA mode), but where to go from here, and what is the Intermediary DMA channel? It doesn’t have to be a fully blown example, a time digram with some comments that explain how to use SDK int this configuration, or even a link may do the trick.
    Please, help.

    Like

  20. Hey, I’m looking for info on how to extend KDS/MCUXSPRESSO IDE to include fractional display of numbers. This was a feature in the CodeWarrior version of the tools. Any links or pointers to how to do this would be appreciated. I relied on this alot, and having to manually convert the data is a bit of a pain.

    Like

  21. Hi Erich. We use the PE SPIMaster_LDD component to access a serial flash. This flash is also used for FPGA configuration. The Data Out lines contend with each other, and the FPGA cannot configure (we only noticed this because of a new MCU and FPGA, where now the MCU ‘wins the war’; it somehow worked on other hardware!). Do you have any suggestions for temporarily tri-stating the Data Out line, for when FPGA configuration occurs? Many thanks in advance.

    Like

    • I have not done something like this with SPI, but a similar thing with I2C.
      There is the ConnectPin method in the SPIMaster_LDD which should be helpful.
      Other than that, what I did for I2C was to use the PDD macros (https://mcuoneclipse.com/2013/05/11/low-level-coding-with-pdd-physical-device-driver/) to mux/unmux the pins.
      Basically adding a function which does the muxing (making the pins active) and de-mux them again.
      How to do the muxing: have a look how currently your SPI pins get configured in the PE_low_level_init().

      I hope this helps,
      Erich

      Like

      • Yes Erich, that did help, thank you! Unfortunately the SPIMaster block doesn’t also have a DisconnectPin method, which would have made the whole thing trivial 🙂 The PDD macros did the trick, with a bit of fluffing around. Cheers 🙂

        Liked by 1 person

  22. Hi Erich,
    We have a family of substation/industrial power meters based on mcf52259. They were developed using the CodeWarrior 7.1 toolchain on XP, and debugged from ELF files using P&E BDM devices. The meters are still in production and require occasional extensions. We need a working ColdFire toolchain and debugger.

    We can compile and link in two ways (Win10 & Wine under Linux), but can’t get the CodeWarrior BDM debugger and the P&E devices (USB or Ethernet) to attach to a target in either environment.

    Can you suggest a way to use ELF/BDM to debug the target on Win10 or Linux?

    Thanks,
    Paul

    Like

    • Hi Paul,
      I’m using CodeWarrior v11.1 and that works fine for me under Windows 10 (64bit).
      I suggest you give this a try (there is still a free ‘special’ edition available).
      I hope this helps,
      Erich

      Like

  23. Hi Erich,
    Thanks for all the work you put into this amazing blog. It’s truly a fantastic resource.

    I’m working on a proof of concept with an RT1064 EVK. The main area of interest for this project, and the one I’ve been having the most difficulty with, will be using IEEE1588v2 to synchronize audio sampling between multiple RT1064s, using FreeRTOS and lwIP.

    Now this is quite similar to the NXP app note (AN12149 [https://www.nxp.com/docs/en/nxp/application-notes/AN12149.pdf]). The issue with it however, is that it’s from 2018 and activity in the forums suggest that it was already difficult to implement a mere 2 months after its release with SDK and PTPd changes (https://community.nxp.com/t5/i-MX-Processors/AN12149-IEEE-1588-Sync-Error/m-p/830445). It’s also built for IAR and I’m using MCUXpresso.

    All this to say is that I’d love to see a post of you diving in to the implementing PTP (especially when NXP has numerous offerings that tout support for it) in a similar way.

    Thanks so much and happy holidays.
    Cheers,
    Sean

    Like

    • Hi Sean,
      many thanks for that feedback!
      About PTP: this has been on my growing list, but never had a project which needed it or the time to play with it. Thanks for the pointers and the community threads, this is really interesting and I need to keep this in mind if I get a chance to get my hands on it. But probably won’t be in the near future (still need to write all the exams for January).
      Happy Holidays for you too!
      Erich

      Like

  24. The Kinetis MKL has a BME (Bit Manipulation Engine) which seems like it would allow for smaller code and faster speed for toggling register bits. But I can find little information on actual use. And it doesn’t appear that the GCC compiler is making use of it. (nor is it mentioned in the MKL05Z4.h header or PDD driver, or CMSIS) Do you have any experience with it? Is it worth the trouble to implement in a timing-critical ISR?

    Liked by 1 person

    • I have not used BME much. The compiler cannot use it directly because he would need to know about the special memory aliases. What makes it difficult is that not all ARM devices have it implemented, so makes porting between devices difficult. For very time sensitive code BME makes sense.

      Like

  25. Hi Erich

    I have been on a whirlwind tour for the past week, from seeing the amazing clockclock design and (immediately after seeing the price tag) on a mission to build something myself. All of this is new to me, so I have a massive learning curve ahead but I am focussing on ‘MadebyMorgan”‘s Clockception and the 4 time zone ‘Stepper Clock’ you designed. I have a few questions which would really help me along my journey, if you have the time to respond, I’d be extremely grateful:-

    1. I see you have a PCB for your dual spindle stepper (in order to make your 4 time zone clock). Is that something I can purchase (ideally with the components already soldered)
    If Y – can you give me a link?
    If N – can you suggest an alternate method?

    2. You also mentioned wiring them up, so they run quietly, could you elaborate on that please, as I am starting from zero knowledge.

    3. Lastly can you offer any pointers to how I get the hall effect to work. I know it’s magnets and a sensor but unsure of the code needed to capture the positions (it may be in your docs which I will read next)

    If I can make both the 4 time zone clock and the Clockception (using the BDA30-R5 instead and the hall effect synchronisation) I would be over the moon.

    Lastly, your work is just breathtaking, I am absolutely blown away by it. I’m unsure if I am taking on more than I can chew, but you’ve got to try right ??? 😉

    Thanks very much

    Tahir – England

    PS – I am about to buy my first 3D printer, but obviously do not have a PCB oven or laser cutter or infrared heater. I do have a good soldering iron and a hot air station / very small heat gun

    Liked by 1 person

    • Hi Tahir,
      thank you for your kind words: it is always good to hear that my work can inspire other ‘makers’.
      About your questions:
      You could build that 4-time-zone clock with the clock PCBs I have created for the MetaClockClock project. What you would need are two motor PCBs and two MCU PCBs, then connect them with the RS-485 link.

      1. You can order the PCBs from PCBWay (it is a shared project):
      MCU: https://www.pcbway.com/project/shareproject/MetaClockClock_MCU_Board.html
      Motor: https://www.pcbway.com/project/shareproject/MetaClockClock_Motor_Board__Satellite_.html
      You can order just the PCBs, then you have to solder the parts. But be warned: you have to SMD solder them, which is not easy for a beginner. The QFN package are hard to solder with a solder iron: if you are experienced, you can solder them with solder paste plus a hot-air station.

      An option would be that you let the boards assembly by PCBWay: I have submitted to them the full BOM, and I know others did order from them that way. Of course this will be more expensive than doing it yourself. A challenge these days might be that electronic parts might not be available, so be prepared for that.

      Alternative method: Use the approach as in https://mcuoneclipse.files.wordpress.com/2019/11/testing-the-vid28.05.png and use some wires with soldering. Soldering the VID28.05 on a break-out board is rather easy, you should be able to get such breakout boards (PCBs to solder the chip on it) easily on AliExpress and other sources. Then you could use it with a board like the LPC845-BRK.

      2) See https://github.com/ErichStyger/MetaClockClock/wiki and especially https://github.com/ErichStyger/MetaClockClock/wiki/Hardware for the wiring.

      3) It is is simple on-off switch thing: when the magnet field enters the sensor area, the sensor changes the output value. All what you need is to read the pin and find out if it is high or low. Depending on the sensor used you will need a pull-up resistor.

      I hope this helps?

      Happy Holidays!
      Erich

      Liked by 1 person

      • Hi Erich,
        Thanks for the fast reply 🙂
        I’m trying to read up as much as I can, bust still have a few more questions, if that’s ok:-

        1. If I order 2x motor and 2x mcu and pair them, I end up with Motor-MCU, Motor-MCU. In fact I looked at your 24 clock set up (amazing!) and see they are all paired up in this way. In my situation of getting all 4 clocks in sync, do I need to connect them to a Master chip ?

        2. How many / which cables would I need for the 4 time zone set up ? (I’m guessing 2 x the flat white ribbon cables, power cables and a RS-485 external cable for power and possibly data) ??

        3. Once I have this working, how would i make changes (to play/learn/tinker with the code) e.g. set the clocks to different countries or change the synchronised order they move in (on all 4 faces)

        4. I can see there are already 2 hall sensors on the PCB’s, so presumably, the software automatically synchronises the hands ?

        I agree completely that SMD soldering is way too difficult for a novice like me, but I do have basic soldering skills. However, getting the components/motor assembled, although, more expensive would be the right option for me

        Happy holidays to you too and thanks again!

        🙂

        Liked by 1 person

        • Hi Tahir,
          1) You don’t need a master for this: one MCU board can be the master and control the other. The master is only needed for larger installations where it needs more memory for all the states and data. For a 24 clock version a master would not be strictly required, but it adds convenience.

          2) You would need a RS-485 (2pin) connection cable between the two MCU boards. 2x 3pin for the magnet sensors. 4x 4pin cable for the external motor PCB. Plus 2x 4pin for the power cable, plus one to supply the power to the 4 boards.
          You can see a possible wiring here too: https://mcuoneclipse.com/2021/07/11/round-metaclockclock/

          3) You can take the software on https://github.com/ErichStyger/MetaClockClock as a starting point. That code includes the code for the 4 time zone original clock, but you have to update/change it for your use case which is a bit different.

          4) See https://github.com/ErichStyger/MetaClockClock, which includes the hall sensor handling.

          Erich

          Liked by 1 person

        • Hi Erich,

          I need to go for it, otherwise I will be dillydallying forever. If I aim to build the world time stepper clock, I can play around to better understand how it works afterwards. For example:-
          a. Learn to change the time zones so it displays England, California, New York and Sydney-Australia.
          b. Learn to change the patterns etc

          So far, I am clear on …
          — 2xMotor PSU with components (and motor) assembled/soldered
          — 2xMCU PSU with components (and motor) assembled/soldered

          In regards to the cables, are they standard cables I can buy them or do I need to get the connectors and make them up myself ? presumably, they are straight cables (e.g. pin1 to pin1, pin2 to pin2 etc). I am happy to do this if it’s straight forward.

          As i’ll be presumably waiting weeks/months for them to arrive, should I consider getting anything else at the same time or is that fine to start with ?

          I can 3D print anything needed, although, I need to decide on which 3D printer to purchase!

          Also, I can get magnets for the hands for the hall sensor / calibration

          I can make a design for the clock face (although, I might need to remove the 3 pins for the LED’s, as the clock face will be flush)

          ** Where I will definitely need help, is fixing the code to make the stepper time clock work, so if you can give me a hand with that, I should be able to get it working! – It will be good for me to try to understand some of the code but there’s a lot to take in for an absolute beginner.

          Thanks Erich, I really appreciate your support so far, have a great New year in Switzerland, it’s such a beautiful country!

          🙂

          Liked by 1 person

        • Hi Tahir,
          Cables: no, they are not straight cables to allow daisy chaining. But you can order ‘not in same plane’ cables from some vendors, or order ‘straight’ ones and change them using a nail or something similar.

          As for the electronic components: be aware that some might have 52+ weeks delivery time, so you need to see what you can get by when.

          Source code: you need to learn that yourself, or simply start with a new code base. If you are not experienced in C/C++, this might be a steep learning curve for you. But that way you learn the most. I’m afraid that I won’t be able to help you much. I recommend that if you pair up with someone you know and is local to you, that way you can learn it together.

          Liked by 1 person

  26. 52 Weeks Plus- Wow!, I really need to give this some careful thought.
    I might get some bits (i’ll see what’s available) and have a play, just wondering now if the “DIY Stepper Motor Clock with NXP LPC845-BRK” project might be a better place for me to start ?

    So many options!!!!

    Thanks for all of your help, and fast replies, they are much appreciated!, I hope you have a good 2022
    Cheers Tahir

    Like

  27. Hi Erich, have you written any articles on how to code in C++ for Cortex-M, using makefile or CMake? I am particularly interested in startup code requirements.

    Liked by 1 person

    • Hi David,
      about make files: https://mcuoneclipse.com/2017/07/22/tutorial-makefile-projects-with-eclipse/
      Cmake: I cover some of this with my Visual Studio Code series, e.g. https://mcuoneclipse.com/2021/05/04/visual-studio-code-for-c-c-with-arm-cortex-m-part-2/
      about what is needed for C++/Startup: this depends on the library used, but here is maybe a good start:

      Optimizing the Kinetis gcc Startup

      From C to C++: Converting Eclipse C Projects

      Erich

      Like

      • Hi Erich,
        I am trying to integrate the recorder library for trace feature into my nxp design studio for s32k144, i am unable to do that i m getting several errors:

        Description Resource Path Location Type
        C:/NXP/S32DS_ARM_v2018.R1/S32DS/S32SDK_S32K1xx_RTM_3.0.0/platform/pal/inc/can_pal.h unknown type name ‘flexcan_id_table_t’ bms_lv_48v_shikra_nxp_GT11201_v1_0_pa line 140, external location: C:\NXP\S32DS_ARM_v2018.R1\S32DS\S32SDK_S32K1xx_RTM_3.0.0\platform\pal\inc\can_pal.h C/C++ Problem
        C:/NXP/S32DS_ARM_v2018.R1/S32DS/S32SDK_S32K1xx_RTM_3.0.0/platform/pal/inc/can_pal.h unknown type name ‘flexcan_rx_fifo_id_element_format_t’ bms_lv_48v_shikra_nxp_GT11201_v1_0_pa line 139, external location: C:\NXP\S32DS_ARM_v2018.R1\S32DS\S32SDK_S32K1xx_RTM_3.0.0\platform\pal\inc\can_pal.h C/C++ Problem
        C:/NXP/S32DS_ARM_v2018.R1/S32DS/S32SDK_S32K1xx_RTM_3.0.0/platform/pal/inc/can_pal.h unknown type name ‘flexcan_rx_fifo_id_filter_num_t’ bms_lv_48v_shikra_nxp_GT11201_v1_0_pa line 138, external location: C:\NXP\S32DS_ARM_v2018.R1\S32DS\S32SDK_S32K1xx_RTM_3.0.0\platform\pal\inc\can_pal.h C/C++ Problem
        make: *** [SDK/platform/drivers/src/flexcan/subdir.mk:49: SDK/platform/drivers/src/flexcan/flexcan_driver.o] Error 1 bms_lv_48v_shikra_nxp_GT11201_v1_0_pa C/C++ Problem
        make: *** [SDK/platform/drivers/src/flexcan/subdir.mk:57: SDK/platform/drivers/src/flexcan/flexcan_hw_access.o] Error 1 bms_lv_48v_shikra_nxp_GT11201_v1_0_pa C/C++ Problem
        make: *** [SDK/platform/drivers/src/flexio/subdir.mk:42: SDK/platform/drivers/src/flexio/flexio_common.o] Error 1 bms_lv_48v_shikra_nxp_GT11201_v1_0_pa C/C++ Problem
        make: *** [SDK/platform/drivers/src/flexio/subdir.mk:50: SDK/platform/drivers/src/flexio/flexio_i2c_driver.o] Error 1 bms_lv_48v_shikra_nxp_GT11201_v1_0_pa C/C++ Problem
        make: *** [SDK/platform/drivers/src/lpi2c/subdir.mk:49: SDK/platform/drivers/src/lpi2c/lpi2c_driver.o] Error 1 bms_lv_48v_shikra_nxp_GT11201_v1_0_pa C/C++ Problem
        make: *** [SDK/platform/drivers/src/lpi2c/subdir.mk:57: SDK/platform/drivers/src/lpi2c/lpi2c_hw_access.o] Error 1 bms_lv_48v_shikra_nxp_GT11201_v1_0_pa C/C++ Problem
        make: *** [SDK/platform/drivers/src/lpi2c/subdir.mk:65: SDK/platform/drivers/src/lpi2c/lpi2c_irq.o] Error 1 bms_lv_48v_shikra_nxp_GT11201_v1_0_pa C/C++ Problem
        make: *** [SDK/platform/drivers/src/lpspi/subdir.mk:63: SDK/platform/drivers/src/lpspi/lpspi_hw_access.o] Error 1 bms_lv_48v_shikra_nxp_GT11201_v1_0_pa C/C++ Problem
        make: *** Waiting for unfinished jobs…. bms_lv_48v_shikra_nxp_GT11201_v1_0_pa C/C++ Problem
        unknown type name ‘flexio_common_state_t’ flexio_i2c_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 121 C/C++ Problem
        unknown type name ‘flexio_driver_type_t’ flexio_i2c_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 96 C/C++ Problem
        unknown type name ‘flexio_driver_type_t’ flexio_i2c_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 131 C/C++ Problem
        unknown type name ‘lpspi_clock_phase_t’ lpspi_master_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 60 C/C++ Problem
        unknown type name ‘lpspi_clock_phase_t’ lpspi_slave_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 54 C/C++ Problem
        unknown type name ‘lpspi_sck_polarity_t’ lpspi_master_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 61 C/C++ Problem
        unknown type name ‘lpspi_sck_polarity_t’ lpspi_slave_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 56 C/C++ Problem
        unknown type name ‘lpspi_signal_polarity_t’ lpspi_master_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 56 C/C++ Problem
        unknown type name ‘lpspi_signal_polarity_t’ lpspi_master_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 232 C/C++ Problem
        unknown type name ‘lpspi_signal_polarity_t’ lpspi_slave_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 52 C/C++ Problem
        unknown type name ‘lpspi_state_t’ lpspi_master_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 131 C/C++ Problem
        unknown type name ‘lpspi_state_t’ lpspi_slave_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 100 C/C++ Problem
        unknown type name ‘lpspi_state_t’ spi_com_0.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/Generated_Code line 80 C/C++ Problem
        unknown type name ‘lpspi_state_t’ spi_com_1.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/Generated_Code line 80 C/C++ Problem
        unknown type name ‘lpspi_state_t’ spi_com_2.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/Generated_Code line 80 C/C++ Problem
        unknown type name ‘lpspi_transfer_type’ lpspi_master_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 63 C/C++ Problem
        unknown type name ‘lpspi_transfer_type’ lpspi_slave_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 58 C/C++ Problem
        unknown type name ‘lpspi_which_pcs_t’ lpspi_master_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 55 C/C++ Problem
        unknown type name ‘lpspi_which_pcs_t’ lpspi_master_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 232 C/C++ Problem
        unknown type name ‘lpspi_which_pcs_t’ lpspi_slave_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 55 C/C++ Problem
        unknown type name ‘mutex_t’ flexio.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 88 C/C++ Problem
        unknown type name ‘semaphore_t’ flexcan_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 115 C/C++ Problem
        unknown type name ‘semaphore_t’ flexio_i2c_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 136 C/C++ Problem
        unknown type name ‘semaphore_t’ lpi2c_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 222 C/C++ Problem
        unknown type name ‘semaphore_t’ lpi2c_driver.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 255 C/C++ Problem
        unknown type name ‘semaphore_t’ lpspi_shared_function.h /bms_lv_48v_shikra_nxp_GT11201_v1_0_pa/SDK/platform/drivers/inc line 148 C/C++ Problem

        these errors are coming just after I have included trcRecorder.h file FreeRtos.config am I Missing something while integrating in my project structure

        Liked by 1 person

        • Hi Erich,
          To integrate MCuOnEclipse into nxp s32k design studio projects is there any blog, frankly speaking i am not able to integrate in my application I really need help on this . I followed upto this I dont know how to do it for my case. [i have created my application with s32k144_sdk 3.0.0.0]

          – Edit the McuLib/config/McuLibConfig.h header file which configures the library. Below the settings for the Kinetis (ARM Cortex-M4F with FPU) using the MCUXpresso SDK 2.5.0:
          #define McuLib_CONFIG_CPU_IS_ARM_CORTEX_M (1 || defined(__CORTEX_M))
          #define McuLib_CONFIG_CPU_IS_KINETIS (1 && McuLib_CONFIG_CPU_IS_ARM_CORTEX_M)
          #define McuLib_CONFIG_CORTEX_M (4)
          #define McuLib_CONFIG_FPU_PRESENT (1 || (defined(__FPU_PRESENT) && (__FPU_PRESENT)==1))
          #define McuLib_CONFIG_FPU_USED (1 || (defined(__FPU_USED) && (__FPU_USED)==1))
          #define McuLib_CONFIG_SDK_VERSION_MAJOR 2
          #define McuLib_CONFIG_SDK_VERSION_MINOR 5
          #define McuLib_CONFIG_SDK_VERSION_BUILD 0
          #define McuLib_CONFIG_SDK_VERSION_USED McuLib_CONFIG_SDK_MCUXPRESSO_2_0

          Like

        • I have not used the S32 SDK for a while, because the restrictive licensing of it makes it hard to use. For example the licensing terms do not allow me to share an example or put source code on git :-(. I suggest that you carefully check the compiler/linker error messages, hopefully they tell what is wrong?

          Like

  28. Hi Erich,
    I was searching for 3D printed SMT cut tape holders and came across your page. Your solution is very well thought out. I had not thought of needing a lid, but that is a grand idea. I’m in the process of building my P&P machine and the strip holders are next on my list. I really want to use those before trying to move on to real automated feeders.

    I searched, and didn’t see if you had posted the design files. Is this something you had or would be willing to share?

    Thanks for your consideration!
    Mark

    Liked by 1 person

  29. Hi Erich,
    Have you tried utilizing the eDMA controller with UART (e.g. on the TWR-K64F or FRDM-K64F)? I’ve tried to work through the SDK example, Config Tools eDMA setup, and any documentation that Kinetis/Freescale provides, but it’s all pretty tough to follow. I’m simply trying to buffer incoming bytes received by a UART, so that the CPU doesn’t have to step in after each received byte. Seems like a straight-forward use case, but the Kinetis documentation doesn’t make figuring this out very easy. Any help you can provide would be appreciated.

    Liked by 1 person

  30. Hey, Erich! This is “aaronm” from the NXP forums. You solved my issue with the raw LPC812 the other day: I was ignorant of the “Functional Group Properties” button in the Pins page for the raw chip. You mentioned that you take a different approach for individual chips in contrast with evaluation kit boards. Have you done an article on your approach for raw chips? If not, would you consider it? I’d like to see how you handle things in those circumstances. Thanks! Aaron

    Like

    • Hi Aaron,
      to be honest, I don’t remember writing about such a thing on my blog. I might be wrong, because I have to google my own articles ;-).
      But you have a good point: maybe I should post a quick article how I start with a ‘SDK’ project for a bare chip and get rid of all the pre-configured things?
      Erich

      Liked by 1 person

      • Well, you did mention that you used a different approach than the SDK so I’m curious what that approach might be, and what other insights you can share. I’m sure I’m not the only one who’d appreciate it.

        Like

        • In a nutshell, here is what I usually do for a ‘device’ (non-board) project:
          a) create project
          b) get rid of all the board specific config tools code/settings
          c) if using config stuff (for most things): configure it, generate code, then copy-paste into application and delete the config stuff again.
          This works very well for all the pins tool.
          Do you still think it is worth writing about it with more detail?

          Like

  31. Hi Erich,

    I’ve search your blog but did not found a post about the differences between the various std libraries. RedLib, NewLib, NewLibNano (and all the variants). With the current MCUXpresso we have a choice of 13 possibilities !
    What about writing a blog post on this topic ?

    Best regards,
    Nicolas

    Like

  32. Hi everbody,

    Can someone help me? I have some trouble with configuration of MPU Access Permissions NXP IMXRT1060.
    I would configure two regions in RAM that are unprivileged permissions (RW for privileged and RO for unprivileged).

    So, 1st region can write in here region but not in 2nd region.

    I try this without success:

    /* Region 6 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU->RBAR = ARM_MPU_RBAR(6, 0x20000000U);
    MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_URO, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_64KB);
    /* Region 6 setting: Memory with Normal type, not shareable, outer/inner write back */
    MPU->RBAR = ARM_MPU_RBAR(7, 0x20010000U);
    MPU->RASR = ARM_MPU_RASR(0, ARM_MPU_AP_URO, 0, 0, 1, 1, 0, ARM_MPU_REGION_SIZE_64KB);
    ARM_MPU_Enable(MPU_CTRL_PRIVDEFENA_Msk);

    Any idea?

    Thanks.

    Morgan

    Like

  33. Dear Erich,
    first of all I would thank you for your blog that’s very exhaustive!
    I aks you help about an issue on a Kinetis MCU (MKL13Z32): during flashing with SEGGER Flasher probe on SWD interface, connection with MCU is established correctly but the tool (J-Flash v7.60b) returns the error “Failed to download RAMCode”.
    Same problem occurs when I try to read or erase the chip.
    SWD circuit is the same I already use with other MCUs of the Kinetis family (e.g. MKL14Z64, MKL16Z64, MKE15Z64 and so on).
    The only way I have to flash it is connecting to Bootloader via UART (PTA1 and PTA2) but I prefer to flash via SWD because the board was already designed.
    Have you ever seen a problem like this?
    Thank you in advance for your help.

    Like

    • Hi Daniele,
      first: thank you, you are welcome :-).
      About the issue: I don’t have any KL13Z32. But the message “Failed to download RAMCode” means that the debug probe was not able to download the flash programming applet to the RAM of the device. For the J-Link be able to program the FLASH, it stores a little program into RAM which then communicates with the debug probe and programs the FLASH.
      Possible reasons:
      a) bug in J-Link software and they are not using a correct RAM address, as very often debug probe vendors have to implement things ‘blindly’ without real hardware. Try to upgrade to the latest J-Link software, maybe this is already fixed.
      b) You did not specify the correct device in your debug settings, so it is using a different memory map. Check your settings, and check the console output what it is passing to the J-Link
      c) Unlikely, but you could have a debug probe hardware problem: check the SWD cable/connection too.
      d) in any case, you might contact SEGGER about it.
      I hope this helps?

      Like

  34. Hi Erich,
    I’m currently writing a book including presentation of Sumo-Robot competition.
    I would like to include a picture posted on the 3 sept. 2013 shwoing the ring with 3 robot.
    Would you authorize the reuse of image with credit ?

    Like

  35. Hi Erich.
    I came across your flip dot display board project.
    Would you be interested in making a custom timer message board? I” d like to tell/email you more about the project, please let me know. Thank you

    Like

  36. Erich, the concept of test driven development is not hard. But I have no idea how to set up the test stucture in the eclipse environment of MCUXpresso. What would the folder structure look like? Would there be some other “main” for testing in my project. Would it be a separate project that would reference my actual source files? Would you please consider if a post on TDD fits in with the scope of what you want to do?

    Like

    • Hi Kevin,
      I see basically two approaches: one is to have the test code inside the driver, so it is not separate. This has the benefit that everything is together, and test code can be run any time, and is part of the normal build. But the linker will care about stripping it off if testing is not enabled. But it grows the source files.
      The other approach is to have a test module (e.g. sensor_test.c for sensor.c): that keeps things cleaner and separate.
      I did start with the first approach, but moving more to the second approach recently.
      Maybe this would be worth a blog article, maybe?

      Like

  37. MCUXpresso 11.8 just released, moving from GCC 10.2 to 12.2, which is quite exciting for those of us using C++. Will you be covering the new release, or did you go all in on VSCode?

    Like

  38. Dear Erich your dedication in this blog is amazing! And very usefull for the guys like me! whose are starting to investigate different branchs of embedded systems. Thanks a lot!
    Erich i read your articles about Interrupts on Cortex M and the relation between FreeRTOS with those Microcontrollers. It would be very useful for the community if you make an article between RP2040 (Cortex M0) and FreeRTOS.
    For Low Power applications, im trying to stop or freeze the FreeRTOS and restart it. Because i have an stage that, for example, the RP2040 needs to sleep because it´s necessary to save the power.
    I’m having problems for stop FreeRTOS or parts of it. If you can orient me with texts or info, i will appreciate. But your posts are more useful 😉

    M0 plus RP2040 plus Low Power Apps and FreeRTOS, are terms wich are it never gets old-fashioned. 😉

    Regards from Argentina

    Like

    • Hi Rhys,
      my use cases and projects using FATFS were driven by the requirements to interchange data with the host (SD cards and USB MSD devices), so I have used FatFS for this. I had used FatFS with a SPI flash device in the past, but all newer projects using a file system with serial/SPI flashes are using TinyFS because it is more robust against power failure.

      Like

What do you think?

This site uses Akismet to reduce spam. Learn how your comment data is processed.