Q&A


Everything you always wanted to know about Eclipse, Embedded Systems Programming, Software and Tools, or any topics of this blog, but where afraid to ask, then this page is for you.

Post a comment, and you might get an answer, either from myself or from the readers of this blog. Otherwise: the answer is always ‘42‘ 😉

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

Advertisements

808 thoughts on “Q&A

  1. Hi Erich,
    I need to implement a control loop to control pressure in a chamber. Also separate loop to just control the temperature of a heater.
    I thought that using your PID components would allow this, but I noticed the PID_integer wanted to add motor and quadrature stuff which isn’t needed.
    I tried the PID_float component, but I don’t really know how to use it, I could maybe make some good guesses, but is there an example somewhere? Or documentation?

    Many Thanks,
    Brynn

    Like

  2. Hi Erich,
    Another question – I have 5 I2C devices on one bus, and from time to time that bus can get locked up (SDA remains low). Is there a way to reset the bus to get it going again? I’ve had to power cycle my board sometimes to get rid of the lockup, other times just resetting the software works. Using the GI2C component wrapping the CI2C kenitis component (on my K22fn512 board)

    It was working really well for a while, when I noticed my SPI interrupt was not updating the SPI peripheral at 1000Hz. I fixed that, and now the I2C (which is much slower and I have seen the SPI transactions which share no pins come in the middle of the I2C transaction) is locking up much more often.
    Brynn

    Like

    • Hi Brynn,
      do you know who pulls the SDA low? If one of the devices does that, there is not much you can do about it.
      You can try to unlock it with a repeated sequence of data (see https://mcuoneclipse.com/2013/12/08/bit-banging-i2c-with-resetbus-functionality/), but I have this available only in the bit banging version of the driver.
      What I have done in the past to overcome such situations is to power down/up the I2C device(s) with a FET.
      Erich

      Like

      • The earlier version of the board had FETs controlling the power of 3 of the 5 I2C devices (Because they all came at the same address), When any of those three were powered down they dragged both SDA and SCL low so I couldn’t use that to enable/disable them individually – so I removed the feature from the next board. Which is too bad because I cannot power cycle them with software anymore. Though it could well be one of the other two devices that are the culprits.

        Brynn

        Like

  3. Hi Erich
    I am trying to implement a USB CDC host on KL25Z and having lots of problems do it. I am trying to use MQX-Lite.

    case 1:
    I created a project, changed the clock, added consoleIO, and FSL_USB_CDC_Host. Generated the code and then compiled.
    I get errors in the generated code.

    case 2:
    Same as above except the I used the FSL_USB_Stack component and then selected a CDC host. When I compile it, I get errors in the MQXLITE directory.

    Any suggestions as to what is wrong.
    Thanks
    Eli

    Like

    • Hi Eli,
      I have not used MQX (or MQXLite) for a very long time, so I cannot really help on that. I would use FreeRTOS instead. The FSL_USB_Stack is not compatible with MQX, and probably never will be.

      Like

  4. Hi Erich
    I am wondering if you have noticed this:
    I created an application where I added the following components:
    -WAIT
    -ConsolIO
    -FSL_USB_Stack – setup as a USB CDC device
    The only thing the application does is a printf to the console.
    This works fine.

    I than disabled the CDC device and enabled the CDC host.
    Now the printf does not work.

    I did notice that the CDC sub-component changed from CDC1 to CDC2.

    Like

  5. Hi Erich

    I am working with KDS 3.2.0 and the K64F board.
    Two items:
    1-When I add the RingBuffer component from the 2016-10-30 release everything is OK
    When I use the 2016-12-12 release there is a problem with CS1 component.
    Are you aware of this.
    2- I want to use UART1 to communicate with a RS232 printer. If I don’t use flow control I get some bad characters printed. When I enable flow control it does not work at all.
    Any suggestions.

    Like

  6. Hi Erich,
    On my I2C problems, I switched from the kinetis CI2C component to the genericSWI2C component and all My I2C problems went away. I don’t even have to use the ‘ResetBus’ function which was why I switched to the software solution in the first place!

    Today I just made a bunch of changes to my code, and now the KDS V3.2 is giving me phantom compile errors – the error message is telling me that there is an undefined reference to a variable that existed in a previous version of the code, but is no longer used and has been completely deleted. I double click on the error and it puts me on a line of code that is completely different than the error it claims. It is approximately where the old variable existed in the code.

    No amount of ‘clean’ or deleting the debug and generated code directories help.

    Any ideas how to fix this bug??

    Brynn

    Like

    • Hi Brynn,
      Well, my first thought would have been to do a ‘clean’ or delete the ‘debug’ folder. But as you already did this, not sure what else it could be. If it is a undefined reference, it means that the code is using that variable, but it is not defined somewhere. But what sometimes happens is that Eclipse ‘keeps’ the errors listed in the ‘Problems’ view. Check the console view output if the error report is real. You can delete/remove the errors from the ‘Problems’ view (context menu and delete them all or individually).
      I hope this helps,
      Erich

      Like

      • Hi Erich,
        Apparently there were still instances of the not entirely deleted variables elsewhere in the file, and now that I deleted them it compiles again. (but it was still pointing to the wrong places when listed in the problem window).

        Thanks,
        Brynn

        Like

  7. Hi Erich,
    New question – I am using the USB CDC as a debug port and am displaying lots of stuff.
    I changed my code over to using a text frame buffer that I update with values and colors, and then only send a big serial stream of the stuff that changed. (It uses ansi esc sequences to change the colors and position the cursor, and I have a ‘dirty’ bit in the frame buffer that gets set whenever I write new info to the frame buffer)

    It actually works real good – except two things – both having to do with the CLS shell component.
    The first I am sure I can fix so I won’t go into it…
    The second is that after I start typing a ‘command’ to the shell, the other tasks come nearly to a complete stop, and stay sloooow until I hit the ‘return’ to end the command.
    Any suggestions on how to best fix this?

    Brynn

    Like

    • Hi Brynn,
      I have not observed such a slow thing with the shell. Which terminal application are you using? What happens in the shell is that it checks if there are any incoming characters and appends it to a buffer. It uses a function to find out if there is anything available, then gets the character. Maybe something is wrong with this: with your changes it thinks that there is a character, but then when it tries to get it, it runs into a timeout?
      Erich

      Like

      • I just started typing a command now and see that the other tasks have gone slow (like 50x slowdown) but not stopped.
        I hit the ‘pause’ to break where the code is now, and the call stack is:
        Rx1_Get()…
        CDC1_RecvChar() …
        CDC1_StdIOReadChar() …
        CLS1_ReadLine()…
        CLS1_ReadAndParseWithCommandTable()…

        CDC1_RecvChar() is
        while(Rx1_Get(Chr)!=ERR_OK) {}
        and that’s where it is spending 99% of the time

        Instead of that empty while loop I just tried adding a vTaskDelay(1); inside that loop, and it makes my code not slow perceptibly

        Except now that is in generated code and will get overwritten when PEX generates components.

        Did I fix this the right way?

        Brynn

        Like

      • Hi Brynn,
        interesting, I think I see now the problem you describe. Not sure why I have not observed this on my side. Indeed, it should not block that way. I have added timeouts and waiting for the sending, but not for receiving characters. Your fix is basically correct. I need to think this through, a better way would be not to block or to provide a flexible way dealing with this.
        My current thinking is that CDC1_StdIOReadChar() should call Rx1_Get() and not CDC1_RecvChar().

        Like

      • Instead of that empty while loop I just tried adding a vTaskDelay(1); inside that loop, and it makes my code not slow perceptibly

        Actually not true, it is slowed by a factor of 2 or 3, but that is way better than 50x

        Brynn

        Like

      • Hi Brynn,
        I looked closer at what you describe. And my finding is that it should not block like you describe? CLS1_ReadAndParseWithCommandTable() calls CLS1_ReadLine() which first calls io->keyPressed(). This calls CLS1_KeyPressed() which checks using USB1_GetCharsInRxBuf() if there are characters in the Rx buffer. If there are zero, it will not try to read from the Rx ring buffer.
        I don’t know what is happening on your end, as indeed it should not try to read if there is nothing in the buffer?
        That’s why I have not seen such a blocking issue on my side.
        I hope that makes sense, and I don’t know what I’m missing?

        Like

  8. Hi Erich,
    I also have the SeggerRTT component included, as I am using that to dump some logging data.
    I only want the shell responding to the USB commands.

    I do call
    (void)CLS1_ReadAndParseWithCommandTable(in_buffer, sizeof(in_buffer), &CDC1_stdio, CmdParserTable);

    with the CDC1_stdio struct ptr.

    Brynn

    Like

    • Hi Brynn,
      with (void)CLS1_ReadAndParseWithCommandTable(in_buffer, sizeof(in_buffer), &CDC1_stdio, CmdParserTable); it will use the USB CDC as input/output for the shell (UART) communication. You can have as many RTT channels on the side as you want.

      Like

      • Hi Erich,
        I’m still having problems with the CDC blocking. Again, everything is fine until I type the first character of a command. From then until I type a ‘return’, it loops on the code:
        CDC1_RecvChar() is
        while(Rx1_Get(Chr)!=ERR_OK) {}

        I tracked down that CLS1_KeyPressed() is a function that calls USB1_App_Task(…) which returns the number of chars that are in RX1 waiting to be read.

        This is driving me nuts, I think I need to write my own routine that gets my character input and then just calls CLS1_ParseWithCommandTable() to replace the ‘CLS1_ReadLine’ which is the root of what causes that while(Rx1_Get(Chr)!=ERR_OK) {} loop.

        Yes my ‘vTaskDelay’ that I added helps a bunch, but it is also in the generated code directory so it gets overwritten by PEX the next time I generate components – is there a way to change code that was generated by PEX and not have it get overwritten later?
        Brynn

        Like

  9. Hi Erich,
    A different dumb USB question – my code starts talking and sending screens to the USB as soon as the USB is plugged in. But it does that even before my terminal emulator is connected to the USB serial port.
    Is there a function that I can use to actually wait until there is a terminal emulator connection so I don’t send to a non-existent screen? This would also help out because right now my initial screen draws happen long before the terminal is hooked up, and I have to manually type a screen refresh command after it has been connected.

    I see a few likely function names (ApplicationStarted, TransactionsStarted) but I am not sure they or any other function will do what I want.

    Brynn

    Like

  10. Hello Erich,

    I have a bricked KL25Z Freedom Board which has the next versions:
    Board Name is: FRDM-KL25Z
    MicroBoot Kernel Version is: 1.01
    Bootloader Version is: 1.01
    Application Version is: 0.00

    I was watching your tutorial and trying to recover it.
    I know that you said it will not work on versions below V1.11: “only works if the bootloader of the board has been already updated to V111”. But i want to recover this little beast.

    Is there a way to recover this board?

    Like

    • First: it would make sense if you could post your question in that article (easier find for everyone else).
      About your problem: You will need a Windows 7 machine to update the bootloader first, see ‘Updating the bootloader’ in https://mcuoneclipse.com/2014/11/01/illustrated-step-by-step-instructions-updating-the-freescale-freedom-board-firmware/, there is no way around it. Check out the comments section for that article: Mark Butcher posted a hint (I was not able to try that one), but maybe with that one you can do it from a Windows 8.x machine too.
      Good luck!

      Like

      • Thank you Mr. Erich,

        I was able to fix my bricked board following your instructions.

        What i did: I just connected the board to a windows 7 PC and copied the last version of the SDA firmware for this board (MSD-DEBUG-FRDM-KL25Z_Pemicro_v118). After a reset, the board was up and running again.

        By the way, sorry about not commenting on the right post.

        Like

      • Hi Ivan,
        no worries about posting. In any case, I recommend that you update the bootloader too as outlined in the instructions, just in case. Having the new bootloader ensures that you can update the firmware from a Windows 8/10, Mac or Linux machine too.

        Like

  11. hi Eric, how do i toggle program flash protection on a mk22fn1m0vlh12

    i can see how to do it in PE or by using

    /* Flash configuration field */
    __attribute__ ((section (“.cfmconfig”))) const uint8_t _cfm[0x10] = {
    /* NV_BACKKEY3: KEY=0xFF */
    0xFFU,
    /* NV_BACKKEY2: KEY=0xFF */

    etc

    but how do i change the following field in my application:

    /* NV_FPROT3: PROT=0xFF */
    0xFFU,
    /* NV_FPROT2: PROT=0xFF */
    0xFFU,
    /* NV_FPROT1: PROT=0xFF */
    0xFFU,
    /* NV_FPROT0: PROT=0x7F */

    i tried
    NV_FPROT3 = 0xFF;
    NV_FPROT2 = 0xFF;
    NV_FPROT1 = 0xFF;
    NV_FPROT0 = 0x7F;

    but that causes hard fault. i can read from those however.

    thanks for help
    dave

    Like

  12. Hello, Erich!

    I have a sumo robot project in which I use two QTR-1RC digital sensors for detecting the border of the battle ring. I don’t know how to do the code for them. Can you please help me? I am using the FRDM-KL46z. Do I need a counter for using them?

    Thanks.
    Alex

    Like

  13. FRDM-KL24Z + IRDA

    Erich,
    Have you ever done any IRDA using the FlexIO of a KL2x processor.

    I have a FRDM-KL24Z board and can see a demo app for KSDK1.3.0 using a KL43Z.

    http://www.nxp.com/assets/documents/data/en/user-guides/KSDK13DEMOUG.pdf ( search for IRDA )

    I am unsuccessful getting the demo ported over to the FRDM board I have (24z), and have never done any FlexIO implementations yet.

    If you have had some experience in this or some suggestions, pointing me in the correct direction would be greatly appreciated.

    Like

  14. Hi Erich,
    I wrote my own character reading handler instead of calling CLS1_ReadandParseWithCommandTable. In it, I use the NON_Blocking function CDC1_GetChar() . Deep inside the CLS_R…. command above, it calls the blocking function CDC1_RecvChar(). This is what makes that command block. Now that I have my own nonblocking character handler, everything is great.

    Brynn

    Like

  15. Hi Erich,
    I am working a Virtual COM port with the USB port on MK20DX256, bare metal no RTOS.
    I have tried to use the USB CDC CLASS from PEx and USB stack from NXP. I have experienced the “not supported on selected processor” or the similar issue. I have tried KDS 3.2 and Eclipse V10.3. V10.6 with the PEx components from USB stack 4.1.1 , V4.03 and the FSL_USB_Stack from your website, but no luck at all. I also tried to port the example code from SDK 2.0 for MK20 but the debug is such a pain. I really hope that I can use the USB_CDC_CLASS with what ever version IDE from NXP. Any suggestions would be highly appreciated.

    Tony Wang

    Like

  16. Hi Erich,
    I have tried the 2nd link which is for KDS. After plug the USB onto computer with Windows 10, the computer installed the driver itself and the K20DX256VLL10 is shown as COM4. However, there is nothing shown on the terminal. The USB driver for this port is from Microsoft. I will take a further look tomorrow.
    If I plug the same USB at Windows XP or Vista, I will need to manually install the driver.Not sure what driver I should use.
    Thank you so much for the help. Also thanks for the new release of PEx component on March 12,2017. Without this new release, I don’t think I can make the progress so far.

    Tony

    Like

  17. Hi Erich,
    Everything works well. I can get echoed text after send letter or string on the Virtual COM port.Thank you so much.
    Tony

    Like

  18. Hello Erich,

    I am Rashed. I am presently struggling to get the camera (OV7670) work with OPen4X9I-C development board.

    I have been following the example code made by Mr. Jorge’s blog (http://embeddedprogrammer.blogspot.kr/2012/07/hacking-ov7670-camera-module-sccb-cheat.html)

    I have built and debugged the project on eclipse neon.2. But I am trapped in an infinite loop.

    The loop is ov7670 configuration. It is not able to read the camera. I changed and activated all the pheripherals, clock and arrangement. Checked them a lot of times.

    Can you please help me in this project? I am just trapped. I can also send you my project by email.

    Thank you so much for your time.

    Sincerely,
    Rashed.

    Like

    • Hi Rashed,
      I don’t thinkn I have that camera around (I had a similar one), so hard to help you out here. What I suggest is to check the signal lines with a logic analyzer: do they make sense? Do you see the commands you send? Do you see the signals the camera is sending?

      Like

      • Hi again Erich,
        Yes. I did check all those signals. Firstly, after checking deeply the code for peripherals and clock settings, I used oscilloscope to check all the signals on the sensor. It worked well, all the signals show up as they have to.

        I checked them several times. They are working but the code gets into a loop (never ending) and just stays in it sending only unknown default values.

        I checked the signals from data output pins (D0~D7). They all show up nice signals.

        I checked the peripherals for GPIO initialization on a LED test (blinking an LED). It worked nicely.

        I really doubt if USART, DMA and DCMI are working. I am duly checking them again.

        Please let me know if any suggestions you feel I need to check or do.
        Thank you so much for your time.

        SIncerely,
        Rashed.

        Like

  19. Hello erich,
    I’m finishing high school and as final project I have to design a HDK (harware development kit) I decided to base the frdm kl25, which uses a microcontroller MKL25Z128VLK4 (32 bits, ARM cortex M0), since it is open source, in The schematic of the board uses as a debugger the microcontroller PK20DX128VFM5, but this is not achieved. I would like to know all the k20 series of nxp is compatible with the board? Or in its defect why micro could replace it? I wait your answer.
    Thank you
    LINKS:
    debugger: http://www.nxp.com/assets/documents/data/en/data-sheets/K20P32M50SF0.pdf
    micro: http://cache.freescale.com/files/32bit/doc/ref_manual/KL25P80M48SF0RM.pdf

    Like

    • Hi Bill,
      no, I’m not aware of any. But I know there were some at element14 for the FRDM-KL25Z. I planned to 3D print one for my FRDM-K64F boards too, but had not the time for this yet.

      Like

  20. I made a mistake and posted this in requests, but am unable to delete it, sorry.

    Erich or Anyone please.
    Can you give me a link to a starting point for using your PE system with the Kinetis SDK v2.2 please?

    I have to change from MQX to FreeRTOS and SDK v2.2 and wanted to use PE. I used PE a long time ago, v10 and before with CodeWarrior but was blocked because of missing BSP’s for parts I was using and so on. So we switched from PE because MQX was limited with PE.

    And now I find the SDK documentation very difficult to follow with no explanation of why a particular design is being done and just basically incorrect (function calls that do not exist, incorrect numbers of parameters and so on in the example code). So I wanted to go back to PE but I am not sure how to start. I have followed your work for sometime now and always appreciated your clear explanations. I noted that you at one point did not have a way to integrate PE with the SDK v2.2 and that FSL/NXP had stopped the integration with PE after SDK v1.3 but am hoping now that you have found a way through the maze, or I may have misunderstood your recent post. The end result is I am trying to start over again by not sure how to begin. Could you point me to a project that you have done that uses a USB FAT system and or an i2c driver please? There are a lot of projects and ways to fail, so i am looking for a starting point if possible. Thanks.

    Robert

    Like

    • Hi Robert,
      see https://mcuoneclipse.com/2017/03/25/tutorial-using-eclipse-with-nxp-mcuxpresso-sdk-v2-and-processor-expert/.
      I have it working with most of the McuOnEclipse components, FreeRTOS plus peripherals like UART and GPIO. I2C (and SPI) are using GPIO only for now (bit banging). I do have now a basic timer component available too.
      In any case, it is possible to mix the PEx components with the SDK, so you have to use the SDK for now for things like hardware I2C (unless I find a lot of time doing that one too as component).
      There is an (experimental) project for the FRDM-KL27Z on GitHub (https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/KDS/FRDM-KL27Z/FRDM-KL27Z_McuOnEclipseLib) which I’m currently using to have a 1-Wire communication implemented with the SDK and Processor Expert.

      USB and FAT are for sure on my ‘to-do’ list, but I have not portet that one yet. Too many things on my plate right now 😦

      Like

      • Hi Erich
        I got my project moved from FreeRTOS and sdk v2.2 to include PE using your instructions, they were excellent. The wait and LED components work correctly.

        I can see the CI2C1 component in the components library but can I assume that it will work? I can’t figure out how to set it up to get 100K baud rate so far. I did download your github examples and found one that had the i2c component.

        I don’t care if I use the code from the sdkv2.2, for the drivers, all I want is any drivers to work with FreeRTOS and PE. Is there a non sdk v2.2 system that can have a working USB FAT system and I2C? It seems that you have resolved all the build issues so I can’t see why the components would not work or am I missing something?

        I really dislike the sdk v2.2 in its’ present state. The comments for the i2c driver are totally wrong; some of the calls in the example list 2 parameters, but the real calls use one, there are missing functions that are critical and on and on. I think one guy wrote the documentation and someone else wrote the code without communicating. IMHO anyway. It is a hair pulling experience working with it right now.

        Thank you for responding, I know you are very busy.

        Robert

        Like

    • Hi, I sorted it out… found your “Tutorial: Using Eclipse with NXP MCUXpresso SDK v2 and Processor Expert” and it gave all my answers. Thank you very much for the Tutorials

      Like

  21. Hi Erich

    Can you give me some direction on what software systems to use please?

    My priority is to use: FreeRTOS, PE with the Eclipse in Kinetis Design Studio. I have KDS V3.2 and it works. I have PE integrated following your tutorial and this works. I have a CAN driver from the SDK v2.2 that I got working under FreeRTOS and have moved this over to the PE + FreeRTOS + KDS v3.2 as per your tutorial and that all works. But what I need most of all are the Fat file system using the USB Stack, runnning under FreeRTOS and the PE components. I have tried the sdk v2.2 USB Stack with the File system in the example code and it is completely bizarre. I got the test program to load but it does nothing and there is no documentation to know how to run anything. Just a set of innumerable callbacks that does nothing with no explanation as to how to make the whole sorry mess work. I don’t see that as a viable long term supportable system.

    I would be willing to go backward and use v1.3 of the SDK if that is what it takes, to use PE and the above. I would also rewrite the CAN code and use PE components (gladly… I used to use them and they worked great… before MQX was stuck in the mix).

    My problem is I do not know what pieces I should change. Also not all the pieces seem to be there; NXP’s site says sds v1.3 is available for a download but when I try the download I get redirected to download sdk v2.2 which I have. If I find a link that does not re-direct, all I get is a pop-up png with the words “DOWNLOAD”: a bit rude and irritating. I found a link on GitHub for v1.3 built for the FRDM-KL27Z board (not posted by NXP but a contributor), but I use the MK20dx256 part. I am assuming I can change the core with PE.

    I am willing to downshift any of the software and re-install KDS Vn.xx if I could figure out what to do. As I said I want to use the PE components for I2C, FAT, FreeRTOS, CAN and so on.

    I know your system works, I have followed it for years. We could not change before now because of our dependency on MQX but that requirement is now gone. If you could give me any direction it would be very appreciated.

    Thanks again

    Robert

    Like

  22. Hi

    After a bit more searching for a way to update my KDS v3.2 system to use SDK v1.3 in order to use the PE components, I think I need to find the update for Kinetis which is something like KSDK_1.3.0_Eclipse_Update.zip inorder to get KDS to recognize the sdk v1.3. I think I found a version of the sdk v1.3 on my system but can’t find the update plug-in.

    Can someone lead me to the plug-in on Github somewhere, or a link would be appreciated?

    Thanks

    Robert

    Like

  23. Hello Erich,
    I started developing a product with the Raspberry Pi Zero. But after some research it looks like the Pi Zero will never ship in wholesale quantities. So I now have to come up with a small microcontroller board or chip on which to base my product. Do you have any suggestions of something in the general price range and functionality of the Pi Zero that will be around for years to come?

    I just started looking into NXP products but there are a lot of options to sort through.

    Thank you.

    Like

    • I think I am going to go with the LPC1347. I ordered the dev board and will have to create my own board on which to mount the LPC1347.

      Like

      • The LPC1347 is an ARM Cortex-M3 and does not have a FPU to my knowledge. While this is a good device, I would pick a M4 with floating point unit instead. It all depends what the target application will be.

        Like

    • I just see that you picked the LPC1347. Keep in mind that this M3 is much less powerful than the device on the Pi Zero (less FLASH, less RAM, slower speed) and does not run Linux like the Pi Zero.
      If you are looking for a more ‘industrial’ kind of board, you might have a look at the BeagleBone: I know that these boards are used in larger quanties. But if it comes to ‘guarantees’, you might be better going down the route of using a board like the Toradex (see https://mcuoneclipse.com/2016/10/22/tutorial-first-steps-with-nxp-i-mx7-and-toradex-colibri-board/) or similar.
      The thing is that the Raspy is built with such large quantities, you get a lot for your money. But I heard (and believe) that the Pi Zero is sold at about half of the costs (so it must be a negative business). That’s probably why you cannot get it in quantities.

      Like

      • Thank you for the advice. I am already using the BBB and Raspberry Pi 3 on other projects. I just need roughly a dozen inputs and a dozen outputs for this project. The LPC1347 may even be overkill. The Pi Zero was definitely overkill but at $5 a board who cares?

        Like

  24. Hi Erich

    I uninstalled all my KDS and SDK software and followed the steps in your tutorial. It all installed correctly, I left the defaults in place. I manually set the system and user environment variables for (SDK v1.3 because the install did not set them) , KSDK_PATH, KSDK_LOC, to point to the install directory of the sdk v1.3 (C:\Freescale\KSDK_1.3.0).
    I did the eclipse update from the sdk v1.3 tool folder and it said it worked correctly.

    I Rebooted and still the SDK path is NONE for the PE or any other type of project. Even when I choose an v1.3 SDK project from the project wizard! If I choose a V2.x project it asks for a path to the sdk but I don’t have sdk 2.2 installed and don’t want it for the near future if I can use PE.

    Questions:
    1). Do you think that with any new install of KDS v3.2 instead of an upgrade from v3.0 NXP has disabled the ability to use the older v1.3 sdk? Maybe they killed PE for all new and future installs and are maybe trying to force everyone to use just SDK v2.2?
    2). Should I uninstall everything again and install KDS V3.0 and work from there? I have researched the web for a solution and followed every suggestion, but nothing seems to work.

    Thanks again

    Robert

    Like

    • Hi Robert,
      1). I can use KDS V3.2 with the SDK 1.3. In the wizard (File > New Kinetis SDK v1.x) I can manually select and browse fro an SDK (e.g. I have one in C:\nxp\KSDK\SDK_1.3_FRDM-K22F). So this is definitely still there. Make sure you have installed the SDK plugin e.g. from C:\nxp\KSDK\SDK_1.3_FRDM-K22F\tools\eclipse_update
      2) No, this is definitely not necessary. Make sure you have installed/updated the wizard (Help > Install new software, then point to http://freescale.com/lgfiles/updates/Eclipse/KDS).

      I hope this helps,
      Erich

      Like

  25. Hi
    Here is what I did and found:
    1). Installed KDS v3.0 with all the updates as per tutorial, installs had no error
    2), Tried to build a project against a processor core MK20DX256xVLL10 using both PE and just the SDK v1.3, In both instances the environment variables were manually defined by me, but the SDK selection was NONE
    3) Built a project by selecting a Tower board, and the SDK v1.3 was allowed to be selected, added PE and it built a project. I can see all the components.
    4) Retried KDS v3.2, selecting a processor only would not allow the SDK to be selected as per usual
    5) Selected the same board as above and the SDK could be selected, added PE and the project built without problems.

    Conclusion
    Only the board projects work with the file/new/SDK 1.x or Processor Expert. There is no support on my system for creating a project with just a processor. I will try your project generator tutorial and maybe that is a way around this issue.

    If there is a fix for this it might save others some time as well; it wasted a number of hours for me but I am grateful the IDE is usable now. Even if I have to manually re-adjust the code to get around all the extraneous defines for the Tower. I have have had to do this with MQX and the Tower/BSP systems and it was a bit of a mess.

    Robert

    Like

    • Hi Robert,
      maybe it is about the version of the ‘New Project Wizard for SDK V1.x’?
      Here is what I have:
      KSDK 1.2.0 Eclipse Update 1.0.1.b150603 com.freescale.processorexpert.ksdk-1.2.0.sp.feature.group Freescale Semiconductor, Inc.
      KSDK 1.3.0 Eclipse Update 1.0.0.b150914 com.freescale.processorexpert.kinetis-ksdk-1.3.0.sp.feature.group Freescale Semiconductor
      KSDK 1.3.0 KV5xF Eclipse Update 1.0.0.b160311 com.freescale.processorexpert.kinetis-220mhz-kv5xf.sp.feature.group Freescale Semiconductor, Inc.
      KSDK 1.3.0 MK26FN2M0xxx18 Eclipse Update 1.0.0.b151216 com.freescale.processorexpert.ksdk-MK26FN2M0xxx18.sp.feature.group Freescale Semiconductor, Inc.

      Like

      • Hi Erich

        I think I have a simple way around the problem. I think my software has all the latest plug-ins and that they are update as far as sdk v1.3 and KDS v3.2 is concerned.

        I have a new way of using the sdk generator, the sdk-clcp methodology. Or the sdk chicken little, cluck and peck system. Do not pick a tower board unless you have no intention of using your own hardware, rather pick any board until you find one that supports FreeRTOS and the SDK (they all do not… a message often comes up saying ‘FreeRTOS was not available at the time of this sdk’). Generate the project for that board, then go in and use Processor Expert to change the cpu to the one you want, adjust the components and clock and there it is, the sky is not falling… the sun comes out.

        What a mess. Dropping PE was the worst customer decision I have seen to date. I have worked a lot with sdk 2.2 and various IDE’s and much of the sdk 2.2 functionality like the fsl_clock.c system is a redaction of PE’s functionality, for example the web system/desktop system to configure the clocks. And it does not work! The final code generated has modes that do not work and the interface is very poorly documented. They took a working system from PE for the clock and replaced it with a state machine whose api is not even added to the generated code. That code will not even print hello world on the MK60 Tower system. All that was accomplished was to remove a visual working architecture and replace it with a fragmented set of api’s inadequately documented with no cohesive connectivity.

        Anyway I appreciate the work you have done and made public thank you. I hope you stick with the PE system for a long time. Nothing is to be gained going to just the sdk system; and we don’t know what else will be dropped or changed once the next merger goes through.

        Thanks for the help.

        Robert

        Like

      • Hi Robert,
        My students and myself have invested several man years into PE, so we try to continue and keep it alive as long as possible. But I see the challenge with new Eclipse versions coming out. I have PE working in Eclipse Neon, and the only issue is that a few icons are displayed in a wrong way. But what comes out in the next Eclipse version? It very likely means things might be worse. In reality, with PE not be maintained somewhow by NXP (or any other company) it won’t be usable for a longer time :-(.

        Like

  26. Does Processor Expert have anything for the NXP LPC1347? NXP has the SDK option but it does not cover the LPC1347. Is there anything else that you know of associated with MCUXpresso that is for the LPC1347?

    Thank you.

    Like

  27. Hi Erich

    Thank you for you comments and insights above.

    I have found another problem. PE is giving a warning that the USB clock is not set. I can see this problem addressed in older posts on this site. However to correct the problem, I have to switch to Expert Mode, which was the only mode I used when I spent extensive time with PE a few years ago. The problem is that there is no Expert mode on my installation of sdk 1.3, and KDS 3.2… etc. There only is Basic and Advanced. I have looked through the settings and it does not exist (not on the toolset header as well). I am thinking that as a prelude to terminating PE, the support team dropped this feature in-order to minimize the work for the last release. Speculation, but there have been a lot of compromises we have seen now, at the expense of the PE product. As you noted with the setup of the PLL/FLL there are bugs, but without the capability to configure the clocks this is a show stopper.

    So I guess this is the last try; which is to go back and install the set of tools you have listed above and down shift more of the code to see if a working IDE can be built. When I am done I will update here, what does and does not work.

    You may be able to upgrade to the newer toolset functions and sdk (1.2–>1.3), but given the postings I have done, it would be good to be aware of the fact that old installations may upgrade fine, but a new install that a student would do on their own computer would fail. These steps have been a time sink for me with no productivity and they could also be so for someone going directly to the last supported (? sort of) sdk v1.3 with the upgrades.

    Robert

    Like

    • Hi Robert,
      a while back, the Advanced and Expert modes have been combined into the Advanved mode. Which makes sense to me, as having three options does not provide any value to me, and I’m always in the mode which all the possible settings. I have not seen any issues or settings disappear in the advanced mode. About the warning of USB clock not set: this is usually a setting at the bottom of the CPU component settings.

      Like

  28. Hi Erich

    One last update, I have run out of ideas. I am wondering if NXP has modified something beyond redemption.

    1) removed and re-installed KDS v3.0.0 without any updates. No Expert option in PE
    2) installed KDS v2.0.0 without update, No Expert option in PE
    3) Thought some portion of Eclipse could be the problem, therefore created a new account and removed all the Eclipse folders in the system. Removed and re-installed KDS 3.0.0 and still no Expert option in PE. New account had admin priviledge
    4) Took a second totally different PC system, installed KDS v3.0.0, and sdk 1.2, and the sdk update. Still no Expert option in PE
    5) Added the PE v3.01 update to KDS v3.0.0, no Expert in PE

    During the installs I noticed that there are fetches to the Freescale/NXP servers. I am wondering if the code has been disabled on the servers. Some downloads that link to NXP to fetch older SDKs and PE components just pop-up a png that says “Download”. It appears that they took the lazy way of disabling the downloads by changing out the file zip for a png. The Freescale sites still load correctly.

    Is there something I missing that you can see, or can you advise any other way to get this to work?

    Thanks again

    Robert

    Like

  29. Hi Erich

    After much searching and trial and error I found this on the NXP site “In the CodeWarrior 10.6, this has been changed and the Advanced and Expert options are merged into one Advanced view mode so you will see there all available settings.” If this is true then there is no Expert mode, however, to set the USB clock speed… Expert mode is needed according to many other posts.

    The problem is how do I set the USB clock speed that was in Expert mode if Expert mode no longer exists.

    Erich,
    do you have expert mode on your KDS installation? If so is it because you have a component development license and that is required?

    Regards

    Rober

    Like

      • Erich and Robert,
        I checked on my system and in Codewarrior 10.6, PE in the Advanced mode shows the PLL/FLL selection under the System Oscillator part of the Clock settings for the MK40DN51ZVLL10 CPU. So it’s not broken everywhere, but I haven’t switched over to KDS yet, and probably won’t for a while now.
        Greg

        Like

      • Hi Greg,
        yes, the same for PEx 3.x in KDS/etc. The PLL/FLL selection is the same place. But the setting for how the clocks are routed to the USB block are at the end of the settings. That might be different for other supported processors.

        Like

  30. Hi Erich,
    (I was not able to post this in the appropriate thread for some reason.)

    I am trying to follow the instructions for the LPC800 board with an LPCXpresso 1347 V1 board (OM13045). I understand most of the code you have but I am getting an error in MCUXpresso saying that the compiler can’t find chip.h nor board.h. I have both of these files in my src directory and have done Refresh a number of times. I am at a loss as to what to try next. Do you have any suggestions?

    Thank you for your time.

    Like

    • You have to specify the path to to the header files in the project properties > C/C++ build > Settings > Tool Settings > MCU C Compiler > Includes, otherwise the compiler will not find the header files.
      I hope this helps,
      Erich

      Like

  31. Hi Enrich (or who it may concern),

    I’m using CodeWarrior Development Studio with Processor Expert for my Freescale FRDM-KE02Z and I’m having some problems with SPI.
    For a small project, we’re using two development boards, a BeagleBone Black and a FRDM-KE02Z, where the BeagleBone is used for a linux web-interface and it should send 4 different numbers to the FRDM board in SPI.

    To simulate these 4 numbers, I used an example project of the Arduino IDE called DigitalPotControl, removed the address byte and send this to the FRDM board.
    The Arduino program should send SPI at 1 MHz, but measuring with an oscilloscope it is around 4 MHz, which shouldn’t be a problem for the FRDM board.

    For now, I would like to change 4 LED’s on the output pins B2, B3, B4 and B5 (which have been connected, one connection was missing) and would like to know if I do something wrong.

    I tried using the standard Slave mode components available (SPISlave_LDD and SynchroSlave) and implement the typical usage.
    the other Processor Expert components used are two GPIO_LDDs, a TimerUnit_LDD and the NMI is disabled in the processor because of the timer used.

    The SPISlave_LDD does not receive a block and goes into the infinite “while (!DataReceivedFlag) {};” loop since the DataRecievedFlag never goes to TRUE, this is apparent because the LEDs never turn on, even though the code should always turn on an LED.

    The SynchroSlave does receive a character, but it either shows a 0 or 0b00001010U.

    The Arduino is connected from pins 13 (CLK), 11 (MOSI), 10 (SS) and GND to PTE0 (CLK), PTE1 (MOSI), PTE3 (PCS) and GND.
    SPI0 is chosen on SS1.
    GPIO1 is connected to 1 field with pins PTB2, PTB3, PTB4 and PTB5.
    GPIO2 is connected to 2 fields with pins PTF2, PTF3, PTF6 and PTF7.

    If you could help me, that would be great, since I’ve been working on it for a few weeks now, and it shouldn’t be this complicated with Processor Expert.

    Kind Regards,
    Lex van de Wiel

    Like

    • Hi Lex,
      If DataReceivedFlag is not set, this means the interrupt is not triggered. Are you sure interrupts are enabled? I recommend you set a breakpoint in the interrupt service routine to see if the interrupt happens. Make sure the SPI component is using interrupts in the settings with some buffer sizes set. Check the processor interrupt flag (PRIMASK), it should be cleared. I’m not sure why you say NMI is disabled, because the NMI has nothing to do with a timer?
      I hope this helps,
      Erich

      Like

  32. Hi Erich,

    Sorry to bother you again but I don’t know where else to look.

    I am trying to access the GPIO registers for the LPC1347 LPCXpresso board V1. I have successfully run blinky on the board using MCUXpresso.

    But when I try to use the following I get “Syntax Error”.

    Chip_GPIO_Init((*)base_adr);
    Chip_GPIO_SetPinDIROutput((*)base_adr, 0, 7);
    Chip_GPIO_SetPinToggle((*)base_adr, 0, 7, 1);
    x = Chip_GPIO_GetPinState((*)base_adr, 0, 1);

    I am at a loss as to what to try next. Do you have any suggestions?

    Thank you very much for your time.

    Like

    • Hi Erich,

      I found out what I was doing wrong. I needed to put a “void” in front of the * in the statements.

      I don’t understand why that works but it does.

      Like

      • Well, this is basic C programming language. If you cast something, you have to cast it to a type. ‘*’ is not a type, it is a pointer. ‘void *’ is a pointer to anything. Technically void* works (as a wildcard), but is strictly speaking not correct: you should cast it to the pointer the API expects.
        I hope this helps,
        Erich

        Like

      • Thank you, Erich,

        Technically I’m not a programmer. I am a hacker, maker, inventor. My only interest in programming is to make something work for me.

        Nevertheless, thank you for the help.

        Like

  33. Hi Erich

    I am having a hard time getting the USB stack + PE + FatFS working on my custom board mk20dx256VLL10 using the github projects, so I thought a better way to go would be to get a board you recommended that worked out of the box. Then I would have a reference point for testing and understanding the system.

    Can you tell me which project is the most current and which board you would recommend that I buy please for USB stack + PE + FatFS? I do not know the FRDM boards that well. I have an older FRDM-25Z but I would rather buy a board that I did not have to patch anything for 5v and that worked with your most current software system. I saw a reference to the FRDM-27Z but as I say I need some advice please.

    I can see all these really great tools for PE and Perceptio but it is like looking on the other side of a bullet proof window, I know it all works but just not for me… hence the request to start from a known good reference point.

    Thanks

    Robert

    Like

    • Hi Robert,
      I’m travelling this week, so not sure how much I can help you. As for a board recommendation, I would recommend the FRDM-K64F: it is powerful, h as a SD card socket and I have FatFS/FreeRTOS/etc running on it. I have not used the FRDM-K64F in host mode (I think this is what you want?), but I could give it a try.

      Like

    • Hi Robert,
      thinking more about your request, and looking at your other questions, I see that you want to use the SDK v1.3. I have to say that I have not used the SDK v1.x for a while, and I don’t recommend using it. NXP has moved to the SDK v2.x and I doubt there will be any ongoing support for that SDK. What I can offer is an example project with Processor Expert for say the FRDM-K64F board with KDS, FreeRTOS and FatFS: https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/KDS/FRDM-K64F120M/FRDM-K64F_Demo
      As for host support, I have one here: https://github.com/ErichStyger/mcuoneclipse/tree/master/Examples/KDS/FRDM-K64F120M/FRDM-K64F_USB_MSD_Host/Sources

      On another note: as KDS will be in maintenance mode, I’m moving over to MCUXpresso IDE. I have it now updated so it has the same capabilities as KDS, so I can use it with Processor Expert too.
      Maybe you could describe what you need? It will be very unlikely that I find time for the SDK V1.x.

      Like

      • Hi Erich

        I would prefer to use is whatever code base you recommend. The reason I went from SDK v2.2 to V1.3 was I thought from our earlier conversations that your code base did not support PE and SDK 2.2 for your PE component library. I had worked through the integration you posted on PE and sdk v2.2 and did get PE and SDK 2.2 integrated and it worked for the simple components. But I need the USB Stack and MFS for a flash drive but I thought you had said that there was no immediate time to get these integrated.

        I therefore switched to SDK v1.3 and KDS v3.2 to try to get the i2c, usb stack and mfs to work with your components. (There are definite problems with the SDK v2.2 wrt the clock system which was another reason I went to sdk v1.3.) Also I saw that the many projects you had posted all use the SDK v1.2, (possibly I thought SDK v1.3). I have no reason to use the SDK v1.3 apart from getting PE to work.

        I have used mcuExpresso with the sdk v2.2 and parts of it work well but there are broken pieces in that as well. For example the PEE mode will not work on any hardware I used… I had to change that part of the code. Also the clock generator code created by the tool does not include the state machine which is critical to the ramp up of the clock and switching to the final state. I found that by debugging the code, not from the documentation.

        I have found the code base and documentation for the sdk v2.2 terrible. They took 50 lines of code for the clock circuit and turned it into 2000 lines of state machine code not counting the header files that contain macros of c code. The drivers are endless structures and call backs. In my estimation they have gone from a fast working embedded platform, to trying to be a generic software system across all the silicon they must support. They have seem to be trying to make the Cortex core a parallel to a multitasking windows system with soft vectors and so on. This may work well for minimizing engineering support by standardizing on a common software base, but it does not help the end user of a specific core on a Cortex M series that needs speed.

        I am willing to use anything you recommend, I have been trying unsuccessfully to find a path through this maze of discontinued products and broken toolsets from Freescale and NXP.

        What I need are a USB Stack, MFS(readable on a windows platform), i2c, uart driver and interrupt handlers for gpio. I tried the NXP sdk v2.2 USB stack and MFS and could get it to compile, but it did nothing… and there was no documentation on even how to do a simple function like open a file or write a stream to a record. As far as I can see, NXP farmed out the whole project offshore and did next to nothing for the documentation. They used doxygen to create the doc set using poor descriptions in the source code. So of like “you should use the functional mode when you want to do functions, because functions are functional in the function code”, but the comments in the doc set do not match the api calls… well enough said.

        Any direction you could suggest would be much appreciated.

        Thank you.

        Robert

        Like

      • Hi Robert,
        Thanks for your insights. To my knowledge, MFS is a MQX thing (which I never really adopted, and looks I was lucky with that decision). So what it sounds is that you need a USB MSD device class implementation, where you can plug in the board with the USB port, and it will show up as mass storage device you can use to read/write e.g. using a FAT file system.
        I have bits and pieces for this, but not pulled it together. When I’m back from travelling, I could look into this. But I would prefer something like using Processor Expert on the FRDM-K64F with KDS, making the SD card on the board accessible throught the MSD implementation? I would use FatFS for this (and not MFS). Does this sound right?

        Like

  34. Hi Erich,
    I am now switching from a K22FN512 to a K22FX512 so I can add the CAN bus. I have already noticed that the CAN_LDD kinetis PE bean doesn’t show up (because my project for now is K22FN512) unless I select ‘ALL’ instead of ‘applicable to project’.
    Anyway, my dumb question: after I switch over to the FX part will it (KDS 3.2 +segger J-link) let me download and debug both the new FX boards and my older boards that have the FN processor? Or will I need to jump through some hoops to be able to support both with the same code base? There is an IO pin that that I can read to let me know which board version I have (although I also have the CPUID that will tell me which CPU I have, if I look) so that I can have a check before trying to initialize the CAN bus module.
    Brynn

    Like

    • I have not checked the difference between the FN and FX part, but for sure there are some, so I don’t expect drivers to work on both devices ‘as is’. Downloading and debugging should not be a problem.
      If you use the UUID (see https://mcuoneclipse.com/2013/11/30/kinetis-unique-identification-register/) then this ID is unique for every device, so you need to keep a decision matrix to know which device you are.
      I’m doing this for many of my robot projects: based in the UUID I can know which board revision I’m using, so I do not need to waste a pin, and it is much more flexible.
      Check out the KinetisTools component which has functions using the UUID. If you want, I can point you to some code in which I use a table to find out what kind of board/device is used.
      Other than that, there is some familiy ID related information on the device. Not sure if it will tell you the difference between FX and FN, but it gives you information which familiy your are and the FLASH and RAM size information.

      Like

  35. Hi Erich

    I worked with MQX too long and am mixing up the technical terms. I made a mistake in using the term MFS, when what I meant was ‘any system that will support FAT32, running on a USB stack with FreeRTOS as the OS that can use a flash drive’.

    I am confused as to which pieces I should be trying to use. You mentioned that you are transitioning from PE & the SDK system to MCUXpresso, but I thought that all that happened with MCUXpresso is that it generated a file set that contained the source code and headers tailored to a specific processor. They added a partial icon based setup of the ports and clock circuit that generates the port & device init fcns but these files are often just partial extractions of PE code (and even some MQX functionality). As well the driver source is the current SDK which is version 2.2. The middleware pieces and drivers are all in the full sdk v2.2, at least this was my perception when I worked with MCUXpresso.

    What I originally wanted to achieve was, to use PE with the sdk v2.2 and your components, but because I thought there was no of sdk v2.2 with PE + FAT system + USB stack (apart from the FSL USB + FatFs that I could not get to work) I went down the path I described.

    Have you tried to use any processor with the fsl_clock.c from MCUXpresso in PEE mode (not with the internal clock but with an external crystal)? I tried three different K series, 20,40,60 and none of them would work in PEE mode using code from MCUXpresso. There is an error in the fsl_clock code. Also I cannot run up the clock to PEE mode with the code generated by MCUXpresso, it is missing the state machine sequence. It starts in PEE mode with errors in the code and won’t run. This and a lot of other problems caused me to try and get PE + a different USB Stack + FreeRTOS as a base. I thought if this system is so badly tested and the fundamentals are broken, what else doesn’t work? Then I found the i2c driver example code is dead wrong… right in the API doc set the parameters in the called didn’t line up, and that added further concern.

    The key management people for the major software product lines were all let go and the code development went to China as far as I can tell. There they used pieces of PE to assemble parts of the current SDK and generalized the system to cover multiple processor families; but they did not appear to test or validate the pieces as an integrated system. A very frustrating and time wasting experience to throw onto the customer IMHO. The customer base should not be used as a test lab resource.

    The components you have added for the FreeRTOS, PE file system seemed to be the only real path out of the wreckage that resulted from the NXP & FSL merger.

    Thanks for taking the time to respond, I know you are very busy.

    Robert

    Like

  36. Hi Erich,

    I am wondering if you have come across the Cypress PSoC (Programmable System on Chip) technology in microcontrollers? Cypress has combined a PLD in with its MCU on the same silicon. This means that you can define inputs, create a schematic with well over a hundred different types of logic blocks, then send the desired output to most any pin, and not use the MCU whatever.
    The MCU pins can be configured to most any function, unlike any other MCU I have worked with. This means that if you got your TX and RX pins crossed in your final PC board, fixing it is a matter or reprogramming the pins.
    Cypress has created what I think might be the next generation of IDE. Instead of programming registers in C code, you simply drop the logic block components into a schematic, wire it up as you like and then download it into the chip.

    If you want to check it out, I recommend the PSoC 4 Pioneer kit (CY8CKIT-042) for $25 US. But you can get away with something as cheap as $4 US (CY8Ckit-049-42xx). This second kit does not have debugging capability. It has a removable USB to serial bootloader. Snap that off and you have something that can be the heart of you new device.

    There are also lots of video lessons from Cypress on how to use these kits. (Perhaps watching two or three will help you get a better idea of what they are offering.)

    Cypress is the only company that has this PSoC technology. They are also, as I understand it, the world leader in cap sense technology. I think they may have invented it.

    I know you are too busy to change over to Cypress, but I thought I would at least update you on an interesting development in the MCU field.

    Like

    • Yes, I have come across, I’m aware and I’m using the Cypress PSoC. These are great devices, and I love the ability of using its internal programmable logic. With it, I can save board space as I can implement logic inside the chip which otherwise would need some external flip-flops or other circuit. And I like the Cypress tools, they are much like Processor Expert and really easy to use. And proablay you have seen Alan Hawse (https://iotexpert.com/, ) in the videos? Great person! I only had no time left to write more about the PSoC’s due lack of time 😦

      Like

      • Yes, I have watched a lot of Alan Hawse videos. Thank you for including his website. It is helpful.

        Like

  37. Hi Erich,
    We have a project where we are using the LPC4088 because we decided it was the cheapest color LCD solution. I had hoped that we would have been able to us the Processor Expert components with it. Apparently not. (we are using MCUxpresso for the IDE, and went through all the stuff to add PEX to it)
    So, I guess the question: is there a good way to use PEX with the LPC4088?

    For example one of the tasks is to read and write to an external SPI flash chip. I was thinking that I could make a bogus Kxx project and add PEX beans for the SPI flash, generate code, then port that back into the LPC4088 project. Do you think that would work? Can you think of an easier=better way?

    Brynn

    Like

    • I have used that approach with dummy projects as well, that works well. But keep in mind that you cannot use any standard PEx components for the hardware (like SPI), as they depend on the CPU component.
      For a dummy project, that CPU component won’t match. You can use my generic components, but again you have to add the low level hardware layers to your LPc4088

      Like

  38. Hello Erich,
    I am developing a project that will later run on a K02 processor but, because the hardware is not ready yet, I started implementing it on the FRDM-K64 using MCUXpresso with the MCUXpresso FRDM-K64 SDK. I have not used any configuretion tools, but relied on bits from the supplied SDK examples and also adapted some code that I found on the web.

    My question is what is the best way to go about porting my code to the K02 ?

    I am aware that there will be some issues concerning clocks and pinmux, and of course the project will also have to use the header file for the K02 device instead of the K64.
    Also, there are some board definitions that will have to be redefined to fit the new hardware.

    Like

    • Hi Jesper,
      I would focus on the application code first which should be pretty much independent of the underlying hardware. Then once your K02 is ready, create a new project with the SDK for the K02 and SDK, and move over your application code. Don’t port the SDK, keep things on the application level.
      I hope this helps,
      Erich

      Like

  39. Hi Erich,

    – I’m new to the embedded system world. I used to program web applications project at the moment using javascript also i used in the past programming with ATMEL AT89C51 8-bit microcontroller.
    I started back with nxp k22f board but i saw a huge difference from what i was doing in the past now a day it is kind of framework that provide you almost every thing but if you get an error you have to dig deep which goes into the functions that generated by the processor expert (i use kinetis design studio).
    My question is what is the best book or learning curve to start with a good basics understanding the the modules and how to search inside the tones of PDF in order to figure what i want and how to do it using framework or without it??
    I spent many days trying to figure from where to start my journey of learning.
    You can say that i am lost.
    Any advice please ?!

    Like

    • Hi Ahmed,
      welcome to an exciting world!
      Best advice I can give you is that you sign up for my courses at the university, because this is what I’m teaching there. My view is that learning style is very different, and these days only a few seem to be effective learning with books, so you might have a different style. The thing is that books are usually out of date very fast. What you could do is to use google and search my blog articles for information. You probably have seen my ‘books’ section (https://mcuoneclipse.com/books/). There is good (but a bit outdated) material on the ARM university site (https://www.arm.com/research-education/university).
      I hope this helps as a starter,
      Erich

      Like

  40. Hello Erich,

    I went thro’ your articles on using Freedom boards to debug other
    custom kinetis boards and thought that you are the right person to addrees
    our querry.

    We are interested in knowing the following perticular combination.

    1. We are onto building a custom motor control hardware around MKV46F256VLL16
    For this we have based our hardware on HVP-KV46F150M schematic.
    Obviously we want to include the same debug support as provided in HVP- board.

    2. Since Freedom board FRDM-KV31F is easily available and is also nearest cpu & cheaper,
    we would like to use this board for debugging support.

    Our doubt is, Will OpenSDA sw meant for debugging KV31 cpu mounted here, will allow
    flashing/debugging of KV46 of Target Board.

    3. We do the following steps to isolate the resident KV31’s debug & uart signals.

    i) As explained in your posts, cutting J11 link to isolate resident KV3x SWD_CLK is
    quite clear.

    In this case, it seems, we need to also jump J8 & J12 (on sheet 4 of 5 of
    FRDM-KV31F schematic) to reach SWD-DIO & SWD-CLK signals properly.

    Likewise, for TRACE_SWO signal, lift R80 to isolate the resident KV3x.
    This signal, anyway, is not routed to OpenSDA interface.

    ii) Is it correct, that, for Virtual Serial Port implementation, we will also need to
    route the UART signals viz. UART0_RX_TGTMCU and UART0_TX_TGTMCU
    (on Sheet 4 of 5 of FRDM-KV31F schematic) i.e we need to also isolate
    the UART connection of the resident KV3x.

    This can be done by lifting R24 and R38 and putting jumpers at appropriate places.

    It would be helpful if you can give your comments on above.

    Thank you very much for your time.

    Best Regards,

    Vijay Vaidya
    http://www.tritek.in

    Like

  41. Hello Erich,

    I have a question about NMI. I need to disable NMI input pin and use it as GPIO input. I found and used many solutions for KDS and PE, but not for IAR and SDK 2.2. I have an application using KL17Z64. Because I had a problem with start of the program when the NMI pin was low, I disabled NMI pin in startup by rewriting the value of the register FTFA_FOPT -> NMI_DIS = 0. The NMI_DIS bit is properly written to 0 in debug mode but program gets stuck in the same way like in the case the NMI is enabled.

    Debug log shows:
    The stack pointer for stack ‘CSTACK’ (currently 0x20000508) is outside the stack range (0x20002C00 to 0x20003000)

    Call stack contains: PendSV_Handler + 0x1bffd7fd

    The program doesn’t get stuck immediately but after first interrupt handler call, commonly handler for systick.

    Do you know where the problem can be? What is PendSV_Handler?

    Like

      • Thank you for your reply. I also thought about it. Anyway, if the GPIO PTA14 is pulled up the application is running properly otherwise it gets stuck even when the NMI is disabled. I have never got this issue when using KDS + PE with KL16.

        Like

      • You need that hardware pull up, because it takes some time until you are able to disable the NMI in your software. And if during that time your NMI pin is floating and low, you will get an NMI interrupt?

        Like

      • The NMI input is disabled in register FTFA_FOPT and in the Init is set as a GPIO input connected to the switch. According to the switch state, this input is can be in a low or a high state. If it is in the low state and MCU is booting it will get stuck never reaching NMI interrupt handler.

        Like

      • When the application is already running the GPIO input works fine. In other words, if the state of the pin is hight during init and during running is pulled down.

        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