S32 Design Studio Knowledge Base

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32 Design Studio Knowledge Base

Discussions

Sort by:
Function printf is C library function, which sends formatted output to stdout. Because microcontroller does not contain stdout, it it necessary to redirect it to a different type of output. One of the possible way is using UART. All MPC57xx has LinFlexD module, which supports UART mode.   For proper use the LinFlexD module, it is necessary to initialize it and also create simple functions for transmit and receive data. You can create your own file or use the file uart.c in the attachment. If you want to create your own file, please do not forget to implement the methods, which are called by MW MSL libraries to perform console IO (please look at the attached file uart.c).   In uart.h file, you will find correct function prototypes for functions used in uart.c and also some important enum data types.   Third important file is uart_console_io.c which you find in folder, where S32DS was installed. Open the folder and choose path: S32DS/e200_ewl2/EWL_C/src/sys. This file contains routines which implement low-level console IO routines.   Now, we have all basic files which help us to use printf function. So lets create new project and test printf. Example project is created for MPC5744P.   Create new project, choose EWL library and finish project wizard. Include stdio.h to the file, where you want to call printf function.   Now add uart.c and uart_console_io.c files to the project folder src. Add uart.h file to project folder include.   Initialize system clock and clock for peripherals (look at the attached project). In uart.c file, there are settings for GPIO pins, LinFlex initialization for UART mode and also baud rate calculation (please look at the uart.c file in the attachment).   Now it is possible to use printf function. Important point is, that \n character triggers the data sending. Also, if you do not use this \n character, you will get compile error, but I will explain this further in this tutorial.   Run some terminal emulation, for example Putty and use the following settings:   Now open terminal and  run the code in the microcontroller. This should be the result:   /*************************************************************************************************************************************************************************************/ /*************************************************************************************************************************************************************************************/ /*************************************************************************************************************************************************************************************/   This was the easiest way, how to use printf function. But printf also provides some format characters for printing decimals, floating points, etc. All options you can find in ewl_c_reference.pdf document which is place in S32DS installation folder S32DS/help/pdf.   When you want to use some of the characters mentioned above, you get the following compile error:   When you do not use any format characters in printf argument, function _EWL_CDECL puts(const char_t * s) from puts.c file is called on background. But when you use format characters in printf argument, function int_t _EWL_CDECL printf(const char_t * _EWL_RESTRICT format, ...) from printf.c file is called instead of puts.   Variable result saves value, which function __pformatter returns. But function __pformatter is not implemented. Instead of __pformatter, function __pformatterFP (placed in __printformat.c file) is implemented.   So there are two possible workarounds.   First workaround is place the following code to the Linker flags in project properties: -Xlinker --undefined=__pformatterFP -Xlinker --defsym=__pformatter=__pformatterFP   The code says that there is undefined symbol __pformatterFP (part -Xlinker --undefined=__pformatterFP) and define symbol alias __pformatter=__pformatterFP (-Xlinker --defsym=__pformatter=__pformatterFP ). So from my point of view, symbol __pformatter is replaced by __pformatterFP. Now the correct function is called and the project could be successfully built.     Second workaround is add the printf.c file from S32DS installation folder S32DS/e200_ewl2/EWL_C/src/stdio to the project src folder and exchange __pformatter for __pformaterFP. Clean project and recompile.       I hope this document helps you while implementing printf function in your projects.   Regards, Martin
View full article
Hello,   The new official release of S32DS for ARM v1.2 is available in the download section of S32DS web page: http://www.nxp.com/s32ds       To  install the product the Activation Code is needed. You can Find it under "License keys" tab.   S32 Design Studio is based on Eclipse open development platform and integrates the Eclipse IDE, GNU Compiler Collection (GCC), GNU Debugger (GDB), and other open-source software. This release supports Windows 7/8/8.1/10 (32/64 bit) and Linux versions as well.   S32DS ARM v1.2 main features Free of charge tool with no code size limitation (no license file required) Eclipse Luna 4.4 Framework GNU Tools for ARM embedded processors (launchpad, based on gcc 4.9.3) and ARM64: 4.9.3 20141031 Linaro Libraries included: newlib, newlib-nano and Freescale EWL2 (ewl and ewl-nano) SEGGER J-Link (with SEGGER GDB Server), P&E Multilink (with P&E GDB Server) Fully integrated S32 SDK for S32K144 EAR release v.0.8.1 SDK management included (KEA drivers, FreeMASTER for KEA, AMMCLIB for KEA and S32K) CodeWarrior/KDS project importer GreenHills/IAR compiler support by the new Project Wizard iSystem/Lauterbach debuggers support by the new Project Wizard Kernel Aware Debugging FreeRTOS, OSEK. Devices supported SKEAZN8, SKEAZN16, SKEAZN32, SKEAZN64, SKEAZ128, SKEAZ64 S32K144 S32V234 MAC57D54H   Technical Support S32 Design Studio is supported by NXP community - https://community.freescale.com/community/s32/s32ds/ For more details see the attached release notes.     * Red items are the new features   Regards, Stanislav  
View full article
Hello,   The first official release of S32DS for Power Architecture is available in the download section of S32DS web page: http://www.nxp.com/s32ds S32 Design Studio is based on Eclipse open development platform and integrates the Eclipse IDE, GNU Compiler Collection (GCC), GNU Debugger (GDB), and other open-source software. This release supports Windows 7/8/8.1 (32/64 bit), version for Linux will be released later on.   S32DS Power Architecture v1.0 main features Free of charge tool with no code size limitation (no license file required) Eclipse Luna 4.4 Framework GNU Tools for e200 processors build tools (support VLE ISA only, based on gcc 4.9.2, binutils 2.24 and gdb 7.8) Libraries included: newlib, newlib-nano and Freescale EWL2 P&E Multilink (with P&E GDB Server) New Project wizard to create application and library projects for supported devices Peripherals Register View   Devices supported MPC56xx MPC5601P, MPC5602P, MPC5603P, MPC5604P MPC5644B, MPC5644C, MPC5645B, MPC5645C, MPC5646B, MPC5646C MPC5601D, MPC5602B, MPC5602C, MPC5602D, MPC5603B, MPC5603C, MPC5604B, MPC5604C, MPC5605B, MPC5606B, MPC5607B MPC5606S MPC57xx MPC5775K, MPC5774K MPC5746R, MPC5745R, MPC5743R MPC5777M MPC5777C MPC5748G, MPC5747G, MPC5746G MPC5746C, MPC5745C, MPC5746D, MPC5746B, MPC5745D, MPC5745B MPC5744P, MPC5743P, MPC5742P, MPC5741P   Technical Support S32 Design Studio is supported by NXP community - https://community.freescale.com/community/s32/s32ds/ For more details see the attached release notes.   Regards, Stanislav
View full article
Right click on the Project name in Project Explorer -> Settings -> Cross Settings Be sure to click Apply so the 'Standard S32DS Create Flash Image' section will appear In the Tool Settings tab. Select 'General' under 'Standard S32DS Create Flash Image', now you can specify output in newly appeared option Standard S32DS Create flash image
View full article