S32 Design Studio Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

S32 Design Studio Knowledge Base

Discussions

Sort by:
This document contains the instructions how to download separate elf/srec/hex file to the microcontroller using S32 Design Studio and USB PE Micro Universal Multilink/OpenSDA debug probes. This could be used in case you get an executable/binary image file only without any project or source code. There are basically three ways: flash programming support in IDE. This is only useful for programming the device. (it is available in S32DS ARM v1.3+, S32DS Power v1.2+) Create a new configuration, adjust its name and browse for elf/srec/hex file: Select MCU and specific core you are targeting: Select where the Flash Configuration should be saved into - workspace metadata (local file) or as a specific file e.g. part of an existing project (shared file). This way the config could be e.g.transferred with this project. Click on "Flash" button to proceed to programming. As soon as the device is programmed it's disconnected. 2. Executable file importer. Go to menu File -> Import -> Select "Executable File Importer"  this starts the wizard. This is for programming and debugging an executable elf object file only. Select the MCU/core you are targeting and browse for the .elf file Adjust the project name and create a debug/launch configuration (PEMicro GDB server example). If the .elf file is built on another machine and the source files are available but located in a different folder the source path could be adjusted. Source-level debugging is then possible. Finish the wizard and new "container" project for your elf is created. Its debug configuration opens automatically. "Debug" button starts the load/debug of the selected elf file. 3. reuse an existing project debug configuration or create a new dummy project for loading .elf/srec/hex Create new project which will provide basic debug settings Compile the project Copy the required .elf file to the created project Debug folder Open new project Debug configuration Choose correct project and set the correct .elf/srec/hex you want to download Click Apply button and then Debug button. The debug window with correct .elf file will be opened. Program is downloaded and you are able to debug or run it.
View full article
This document describes, how to create FreeRTOS project for S32K144 microcontroller using S32 Design Studio v1.3 ARM and S32K144_SDK_gcc 1.0.0 RTM. Be sure, you have correctly installed all available updates. S32 Design Studio for Arm v1.3 - Update 1 available  S32 Design Studio for Arm v1.3 - Update 2 available  S32 Design Studio for Arm v1.3 - Update 3 & 4 available  1) Create new project. Choose S32K144 microcontroller. Click Next. 2) Choose NewLib Nano Library, and choose S32K144_SDK_gcc RTM 1.0.0. Click Finish. 3) Open project properties and click Target Processor tab. For Float ABI, choose FP instructions (hard). 4) Open Component Library, right click FreeRTOS component and add this component to project. 5) Last, Generate Processor Expert Code and compile project. Now, you can use FreeRTOS component in your project. Another way is to create FreeRTOS proejct from example. Click New S32DS Project from Example. Choose freertos in S32K144 RTM SDK v1.0.0 Example Projects folder. Best Regards, Martin
View full article
This document shows the step-by-step process to create a simple 'Blinking_LED' project. There is also a video which demonstrates the same steps. This project uses the S32K144EVB-Q100 EVB, connected to a PC through USB (OpenSDA) connection. 1. New S32DS Project OR 2. Provide a name for the project, for example 'S32K144_Blinking_LED'. The name must be entered with no space characters. 3.  Expand Family S32K1xx, Select S32K144 4. Click Next 5. Click '…' button next to SDKs 6. Check box next to S32K144_SDK. 7. Click OK 8. Click Finish, wait for project generation wizard to complete 9. Notice Processor Expert views have opened. 10. Make sure the project is selected in Project Explorer view, then from the Components - S32K144_Blinking_LED view, select: Components -> pinmux:PinSettings 11. From the Routing tab, select the GPIO pin routing group and scroll the list until PTD Pin 15 and Pin 16 are visible 12. Click on the fields in the Pin/Signal Selection and Direction columns to set the following:       a. Row: Pin 15, Pin/Signal Selection: PTD15, Direction: Output       b. Row: Pin 16, Pin/Signal Selection: PTD16, Direction: Output 13. Click Save 14. Project -> Generate Processor Expert Code OR, click the button from the Components view 15. The main.c file from 'Sources' folder should be already open, if not, then i n the project window click to expand the project folder then Sources, and finally double click the main.c file to open it. 16. Expand the clock_manager component in the Components Window, then locate CLOCK_DRV_Init 17. Drag and drop the CLOCK_DRV_Init function into main, after the comment 'Write your code here' 18. Now we need to supply an argument so the CLOCK_DRV_Init() function knows what clock settings to use. With clockMan1:clock_manager selected in the Components view, look at the Components Inspector and locate the name of the only clock configuration listed, 'clockMan1_InitConfig0'. 19. Enter the name of the clock configuration, with address operator, to the input arguments of CLOCK_DRV_Init(). Notice the name is shaded grey and a mouse-hover reveals the definition. 21. Expand the pin_mux:PinSettings component  in the Components Window 22. Drag and drop the  PINS_DRV_Init function into main, below the clock configuration  24. Drag and drop the PINS _DRV_SetPinsDirection function into main immediately after PINS_DRV_Init 25. Drag and drop the PINS_DRV_SetPins function into main 26. Drag and drop the PINS_DRV_ClearPins function into main 27. For each of the PINS_DRV  functions, there are 2 arguments, first is always PTD (which is macro defined in SDK), the second is defined as follows: PINS_DRV_SetPinsDirection: OR-ing of LEDRGB_RED and LEDRGB_GREEN = 1 << 15U | 1 << 16U PINS_DRV_SetPins: Bit shift of LEDRGB_RED = 1 << 15U PINS_DRV_ClearPins: Bit shift of LEDRGB_GREEN = 1 << 16U 28. Include an infinite loop after these functions 29. Drag and drop the PINS_DRV_TogglePins function in to main, and place it inside the 'for' loop. 30. Again, the first argument will be PTD and the second is the same as for PINS_DRV_SetPinsDirection above. 31. Within the 'for' loop, and prior to the PINS_DRV_TogglePins function, add a delay of 720000 cycles int cycles = 720000; while(cycles--); 32. Build 'Blinking_LED_S32DS'. Select the project name in 'C/C++ Projects' view and then press 'Debug_RAM'. Or you can build for Debug_FLASH, but programming RAM won't overwrite anything you already have in FLASH. 33. After the build completes, check that there are no errors. 34. Open Debug Configurations and select 'Blinking_LED_S32DS_Debug_RAM' OR 35. Check the Debugger settings and ensure that 'OpenSDA Embedded Debug - USB Port' is selected for interface. Or select the settings which are appropriate for your hardware configuration. 36. Click Debug 37. Set breakpoint on PINS_DRV_TogglePins. Double-click on the blue shaded area at left on the line of code to set breakpoint. 38. Step through initialization calls 39. To see the output register bits change, go to 'EmbSys Registers' tab and expand 'GPIO', then 'PTD' and 'PDOR'.  Double-click on PDOR to enable reading of the values. 40. Click resume to advance to the breakpoint, see the LED on board change color. 41. Click resume again and see LED change to other color
View full article
Build your project and choose Debug Configuration option  On the left side select Launch Group of your choice (Flash/RAM) and press Debug button Wait while debug session is fully started. If you left default startup configuration - all cores has active break-point at the beginning of main() function. You can chose any core for debugging just by clicking on the core's thread. Sometimes are init functions - including startup of other cores - inside main() of boot core (for S32R274 is boot core Z4). In this case you should let boot core perform init sequence first and then try debug other cores. On next picture are all cores halted.  On this picture are core 1 (Z4) and 2 (Z7_0) running - and third one is stopped. You can perform any debug operation on this core (memory/registers view, instruction step...) without effect on other cores.  On the last picture are running cores 1 (Z4) and 3 (Z7_1) and second core (Z7_0) is stopped and any debug operation can be performed on this core. 
View full article
This document explains how to change the package of a processor expert project, for example, from S32K144 100LQFP to S32K144 64LQFP.  It does NOT explain how to change processor derivatives (e.g. S32K144 to S32K142). 1. Assuming that the project is opened and active, go to Components Library View and click on Processors     2. Expand the repository folders and double click on your processor (e.g. S32K144) 3. Select new package (e.g.S32K144_64) and click on finish. Now the new variant will be added to your project 4. Go to PinSettings component and click on Switch Configuration. This action will change the pins configuration for new package and will discard the original pin configuration.
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
Perhaps you are just using the S32DS for Power for the first time, and maybe you've seen the provided examples and want to learn a bit more about how they were created. Here are the steps to create a simple application for the MCP5748G MCU which toggles a pin causing one of the user LEDs to blink. This example includes use of the S32 SDK for Power Architecture. Please note: There are options in the steps below to cover the case of either the DEV-KIT(DEVKIT-MPC5748G) or Motherboard(X-MPC574XG-MB) with Daughtercard(X-MPC574XG-324DS) hardware EVBs. 1) Launch S32DS for Power 2) Select File -> New -> New S32DS Project 3) Enter a name for the project, such as 'BlinkingLED' 4) Locate, from the list of processors, Family MPC574xG -> MPC5748G, and select it. 5) Click Next 6) Uncheck the boxes for cores e200z4 and e200z2, leaving just e200z4 (boot) checked. This is because the application will run on the boot core and will not use either of the other two cores. 7) Click on the '…' button next to SDKs, in the column for BlinkingLED_Z4_0. 😎 Check the box next to MPC5748G_SDK_Z4_0_GCC to include support for the SDK within the new project and for the core we have selected. 9) Click OK 10) Click Finish to close the New Project wizard window and start the project generation. 11) Wait a minute or two for the project generation script to complete. 12) Go to the 'Components Library' view then locate and double-click on 'pit' component to add it to the project.  Alternatively, right-click and select Add to project. You can verify it was added by inspecting the 'Components - <project_name>' view. 13) With 'pit' selected in the 'Components - BlinkingLED_Z4_0' view, go to the 'Component Inspector' view to see the configurations for the PIT component. Locate the section for 'Configuration 0'. You may have to scroll down to see it. Change the 'Time period' setting to 500000 microsec(0.5 sec). Note that we are editing the settings for Clock configuration 'clockMan_InitConfig0', you will need the name of this configuration later. 14) Back in the 'Components' view, select 'pin_mux' component and return to the 'Component Inspector' view 15) From the 'Routing' tab, select the 'SIUL2' sub-tab and scroll down the Signals list until 'GPIO_0' (DEV-KIT) or 'GPIO_99' (Motherboard) is shown. 16) Change to the following settings: a. Pin/Signal Selection: PA[0] (DEV-KIT) / PG[3] (Motherboard) b. Direction: Output Pin PA0/PG3 is connected to user LED 2 on the evaluation board. 17) All configuration settings are now complete. Click Generate Processor Expert code button in the 'Components' view or use the menu bar Project-> Generate Processor Expert Code. 18) Wait for the code generation to complete. 19) Now, from the 'Project Explorer' view, the generated code is visible in the folder 'Generated_Code' of the project 'BlinkingLED_Z4_0'. 20) If not already open, in 'Project Explorer' open the file 'BlinkngLED_Z4_0\Sources\main.c' by double-click. This will open the file in the editor view. 21) Scroll down until the following comments are shown: /* Write your code here */ /* For example: for(;;) { } */ We need to add some code here to initialize the clocks, timers and pins. Then we will setup a timer interrupt handler to toggle the pin. 22) First we need to initialize the clocks. From the 'Components' view, expand 'clock_manager' and then drag & drop CLOCK_DRV_Init   function into main() of main.c, just after the comments identified in the previous step within the text editor view. 23) Add to the function CLOCK_DRV_Init() , the parameter &clockMan1_InitConfig0 to give it the address of the user configuration structure generated by ProcessorExpert in '.../Generated_Code/clockMan1.c' . This is the clock configuration for which we edited the timer period in an earlier step. 24) Next we need to initialize the pins. Back in the 'Components' view, expand the 'pin_mux' then drag and drop the function PINS_DRV_Init after the clock initialization. 25) Again from the 'Components' view, expand 'interrupt_manager', then drag & drop INT_SYS_InstallHandler  in 'main()'. This installs the PIT channel 0 interrupt handler. 26) Enter the parameters: PIT_Ch0_IRQn, &pitCh0Handler, NULL 27) In the User includes section at the start of main.c, add the implementation of the handler a. Create a function called pitCh0Handler b. In the function body: clear the interrupt flag and toggle LED   /* IRQ handler for PIT ch0 interrupt */   void pitCh0Handler(void)   { /* Clear PIT channel 0 interrupt flag */ PIT_DRV_ClearStatusFlags(INST_PIT1, 0U); /* Toggle LED (GPIO 0 connected to user LED 2) */ SIUL2->GPDO[0] ^= SIUL2_GPDO_PDO_4n_MASK; // DEV-KIT /* SIUL2->GPDO[99/4] ^=SIUL2_GPDO_PDO_4n3_MASK;*/ // Motherboard   } Note: Get PIT_DRV_ClearStatusFlags by drag & drop from the 'pit' component. 28) In 'Components' view, expand 'pit' component and then drag & drop PIT_DRV_Init, PIT_DRV_InitChannel & PID_DRV_StartChannel in main() after INT_SYS_InstallHandler(). 29) Fill in the second parameter of the last function(channel number): 0U 30) Build the code. Click the down arrow next to the 'Build' button and select Debug_RAM. Check that there are no build errors. 31) Enter the 'Debug Configurations' menu: a. From the menu bar, Run -> Debug Configurations... b. From the toolbar, down arrow next to Debug button -> Debug Configurations... 32) The Debug Configurations window appears. Select the configuration BlinkingLED_Z4_0_Debug_RAM from within the GDB PEMicro Interface Debugging group. 33) Select the 'Debugger' tab to setup the connection to the debugger hardware device. 34) Select the PEMicro Interface which corresponds to your setup: a. If using the motherboard, you will likely use the USB Multilink, which is connected to your PC via USB cable (type A on one end, type B on the other) and is connected to the motherboard via the 14-pin JTAG cable. b. If using the DEV-KIT board, you will likely choose the OpenSDA, which is integrated into the DEV-KIT board and is connected with just a USB cable (type A on one end, type micro on the other). 35) Click Debug To launch the debugging session. This will also open the Debug perspective. 36) In the Debug perspective, once the debugging session has fully launched, the code will be executed to the start of main(), where a breakpoint was automatically set for you. Press Resume button in the toolbar, Run -> Resume in the menu bar, or F8 on your keyboard to run the application. 37) You should now see the User LED2 on the board blink every 0.5 seconds. 38) To see the value of the output register bit for the output pin connected to the LED: a. Set a breakpoint on a line within pitCh0Handler() b. Go to the EmbSys Registers view, expand the SIUL2 module and scroll down to the GPDO register index which is accessed in the code. Double-click it to read the value. Expand it to see the individual bits. c. Press Resume a few times to see the register value change
View full article
This document describes how to generate an executable file that includes data flash content and how to program it into DFLASH using PEMicro GDB debugger. The default project generated by the project wizard builds an executable with code flash sections only.  Note: It is demonstrated on MPC5744P project but with some small adjustments it's applicable to any other MPC56xx/57xx derivative supported by S32 Design Studio for Power. Let's first explain how to build an executable that contains DFLASH section:  Check the memory map of the target device in the reference manual to figure out where DFLASH is mapped into.  Add DFLASH memory segment/section into the linker file  (MPC57xx_flash.ld).   MEMORY {     flash_rchw : org = 0x00FA0000,   len = 0x4     cpu0_reset_vec : org = 0x00FA0004,   len = 0x4             m_text :        org = 0x1000000, len = 2048K        m_data :        org = 0x40000000,   len = 384K        int_dram  : org = 0x50800000,   len = 64K                m_dflash :  org = 0x800000, len = 96K    /* data flash memory segment */ }  SECTIONS {   …   .dflash : { KEEP (*(.dflash)) } > m_dflash  /* place .dflash section into dflsah memory*/   … }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Select the data you want to place into the DFLASH section in the source code and associate it with the memory section you created in previous step (".dflash"). __attribute__((section(".dflash"))) const unsigned int dflash_int = 0xFEEDCAFE; __attribute__((section(".dflash"))) const char dflash_char[]= "Hello World form DFLASH!";‍‍‍‍‍‍ ‍ ‍ Build the project and check the generated .map file.  The custom".dflash" section should contain the selected data objects. .dflash         0x00800000       0x1d  *(.dflash)  .dflash        0x00800000       0x1d ./src/main.o                 0x00800000                dflash_int                 0x00800004                dflash_char‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ Let's now adjust the project debug configuration to be able to program DFLASH.  First  make sure you installed the latest version of PEMicro Eclipse Plugin. See the post below - it's about ARM version of S32DS but the update process for S32DS for Power is exactly the same. You just need is to select e200 component instead of ARM: error while dubbing: "ERROR loading to the device"  If you need to control DFLASH programming separately from code flash you would need a separate debug configuration for DFLASH. You can use "Duplicate" feature on an existing Debug configuration. This creates a new configuration with pre-populated fields so you don't have to enter them all manually. Change the debug configuration name and press "Apply" Switch to the Debugger tab -> Advanced Options and tick "Use Alternative Algorithm" option. Open Browse dialog and go to the folder below where all flash programming algorithms are located (*.pcp) and  select the appropriate DFLASH programming algorithm e.g. for this example: freescale_mpc5744p_1x32x20k_dflash_cut2.pcp          "<S32_Power_v1.x>\eclipse\plugins\com.pemicro.debug.gdbjtag.ppc_1.5.6.201703011834\win32\gdi\P&E"   Note: Folder name "com.pemicro.debug.gdbjtag.ppc_1.5.6.201703011834" may differ depending on the latest version of Pemicro GDB plugin version installed on your machine. It's recommended to enter the latest version folder if there are multiple plugin versions available.   If you want to program DFLASH and code flash at once you can just adjust the existing debug configuration. In this case you should select combined cflash+dflash flash algorithm such as e.g.  freescale_mpc5744p_ cflash_dflash _cut2.pcp  Click on debug button and as soon as the debug session is established check the DFLASH memory space in the Memory View
View full article
S32 Design Studio is free-of-charge software that just requires to be activated. The activation process is incorporated into the S32DS installer. Before you proceed to the installation you always need to get an activation code. The activation code is typically sent automatically to your email registered on nxp.com account when you proceed to downloading of S32DS installer. The example of notification email is below:     There are two types of activation you can choose from - online and offline. If your machine is connected to the Internet then in most cases you just select online activation and S32DS gets activated automatically without any additional steps required.   Anyway if the computer that you are installing S32 Design Studio into has no internet access or there are some firewall/antivirus/infrastructure restrictions that voids the online activation you can select offline activation type instead. This document describes the offline activation process step-by-step:   Step 1. S32 Design studio for Arm/Power/Vision installer pops up the "S32DS Activation" dialog  where you first enter your activation ID and select activation type as offline Step 2. The Offline process will require to save an activation request file -"request.xml". Please save this file into a local folder or an USB drive. Step 3. Software will then require an activation response. To get this file move to a station with the Internet connection. We will get back here once we have activation response file ready. Step 4. Look for the Internet connection and take the "request.xml" file with you. Go to https://www.nxp.com/security/login  click on Apps and Services >  "Software Licensing and Support > Click on View Accounts Step 5. In product information page look for the "Offline Activation" option on the left menu. Step 6. C lick on "Choose File" and  select the "request.xml" file generated in Step 2.  Press "Process" button to get the "activation.xml" file. This file will be downloaded.   Step 7. Save "activation.xml" file and take it to the original offline station, go back to the Activation response dialog described by Step 3. Step 8.  Load file and installation will be finished. S32 design studio will be activated with your activation ID.
View full article
This document describes a way how to execute a selected function(s) out of RAM memory for a project running out of  Flash memory. Create a custom linker section in the linker file (.ld) where a routine(s) should be placed into. This step is optional if you don't care where exactly in RAM the function should be placed. In such case default sections could be used instead. MEMORY {       flash_rchw : org = 0x00FA0000,   len = 0x4     cpu0_reset_vec : org = 0x00FA0000+0x10,   len = 0x4     cpu1_reset_vec : org = 0x00FA0000+0x14,   len = 0x4     cpu2_reset_vec : org = 0x00FA0000+0x04,   len = 0x4                  m_my_flash :     org = 0x01000000, len = 4K       // optional - this is dedicated section for the RAM function rom image     m_text :         org = 0x01001000, len = 5628K    // default section for code       m_my_ram :       org = 0x40000000, len = 4K       // optional - specific section where a RAM routine(s) should be copied into     m_data :         org = 0x40001000,  len = 764K    // default section for data/stack/heap }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ If it's intended to keep routine(s) that should be executed from RAM within a specific custom section: SECTIONS { ... .MyRamCode : {    MY_RAM_START = .;       // this symbol is optional    KEEP (*(.MyRamCode))    // KEEP - avoid dead stripping if an object is not referenced    MY_RAM_END = .;         // this symbol is optional } > m_my_ram AT>m_my_flash // the section above is linked into m_my_ram and Rom image is stored into m_my_flash‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Otherwise you can use the default memory areas for code/data if you don't care about the location of the routine(s): SECTIONS { ... .MyRamCode  : {     MY_RAM_START = .;     // this symbol are optional     KEEP (*(.MyRamCode))  // KEEP - avoid dead stripping if an object is not referenced     MY_RAM_END = .;       // this symbol are optional }  > m_data  AT>m_text    // the section is linked into default data memory area and its rom image is placed into the default code memory ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ add the __attribute__ statements to the RAM function prototypes. The function attribute "longcall" is required to be able to call this RAM function from flash. __attribute__ ((section(".MyRamCode")))              // place the function below into .MyRamCode section int test_RAM(int arg1) __attribute__ ((longcall));   // declare the function as "far"‍‍ ‍ ‍ Default S32DS project startup initializes just the default data sections. Therefore it's necessary to perform section copy-down manually if the functions are placed into a custom section. This must be done before a RAM routine gets called e.g. at the beginning of main() or in the startup routine.       You can create some linker symbols (.MyRamCode RAM and ROM addresses and size) and import them to the module where copy-down is implemented. __MY_RAM_ADR = ADDR (.MyRamCode); __MY_RAM_SIZE = SIZEOF (.MyRamCode); __MY_RAM_ROM_ADR = LOADADDR (.MyRamCode);‍‍‍ ‍ ‍ ‍ The final source file may look like this: #include <string.h> extern unsigned long __MY_RAM_ADR; extern unsigned long __MY_RAM_ROM_ADR; extern unsigned long __MY_RAM_SIZE; __attribute__ ((section(".MyRamCode")))              // place the function below into .MyRamCode section int test_RAM(int arg1) __attribute__ ((longcall));   // declare the function as "far" ... void main(void) {    int counter = 0;    memcpy(&__MY_RAM_ADR , &__MY_RAM_ROM_ADR, &__MY_RAM_SIZE);  // copy the function from flash to RAM    counter = test_RAM(counter);                                // call the function ... }‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Hope it helps! Stan
View full article
Hello, the new release of S32DS for ARM v1.3  is available now in the download section of S32DS web page: http://www.nxp.com/s32ds   The Activation code is required to install the product. The activation code is different to previous versions (v1.1/1.2). You should get the appropriate Activation Code by a notification email which is send automatically when you proceed to the downloading: What is new?  New device supported:  S32K144 v2.0 ARM64: Linaro GCC 4.9-2015.05 Fully integrated S32 SDK for S32K144 EAR release v0.8.2 .  including PinMuxing and Processor Expert configuration. FreeMASTER Serial Communication driver for S32K144 family  Highly Assembly Optimized version of Automotive Math and Motor Control Libraries for KEA and S32K devices v1.1.6  IAR debugger support by new project wizard Updated SEGGER and P&E debug plugins to the latest and greatest versions Reset functionality added with P&E debugger for single core projects (KEA, S32K devices) and A5 core for MAC57D54H Flash configuration supported for S32V234 Header files for KEA and MAC57D54H updated Advanced FreeRTOS kernel aware debug support Bug fixes Project Explorer updated to correctly show active build configuration resources     Note: The plugins to support GreenHills, IAR, iSystem, Lauterbach are not included and have to be installed from corresponding update site or installation.
View full article
Installation & Activation HOWTO: Install Wind River compiler Eclipse plug-in into S32 Design Studio  HOWTO: Install Lauterbach TRACE32 debugger plug-in into S32 Design Studio  HOWTO: Install PLS UDE debugger plug-in into S32 Design Studio HOWTO: Activate S32 Design Studio    Getting Started HOWTO: Create a Blinking LED Project (MPC5748G)  HOWTO: Build a Project and Setup a Debug Configuration for debugging in S32 Design Studio   Build tools & standard libraries HOWTO: Run a routine from RAM in S32 Design Studio   HOWTO: Use printf() function and EWL library  HOWTO: Migrate project created in S32DS Power v1.x into v1.2+  HOWTO: Add a static library file into S32DS GCC project  HOWTO: Link a binary file(s) into the application project using GNU build tools  HOWTO: Execute a library function from RAM memory using GNU build tools  NEW!   Debug & Flash Programming HOWTO: download separate elf/srec/hex file to microcontroller using S32 Design Studio  HOWTO: Program data flash (DFLASH) in S32 Design Studio for Power  HOWTO: Program DCF record into UTEST flash in S32 Design Studio for Power  HOWTO: debug multi-core project in S32 Design studio  HOWTO: Update OpenSDA Firmware on EVB  HOWTO: MPC5777C - Low/Mid Flash block erase via PE Micro    HOWTO: Use RappID BL tool with MPC5744p EVB  HOWTO: Debug multiple elf files in S32 Design Studio   HOWTO: Reset MCU in S32 Design Studio debugger (Pemicro/OpenSDA interface)  HOWTO: Program multiple memory types in single debug session   NEW!   SDKs HOWTO: Working with AMMCLib SDKs  HOWTO: Working with FreeMASTER SDKs  HOWTO: Add custom SDK into existing project  HOWTO: Use SDK based example code as standalone (usable for GIT, SVN...) NEW!   General Usage HOWTO: S32 Design Studio Command Line Interface  HOWTO: Add user example into S32DS  HOWTO: Generate S-Record/Intel HEX/Binary file  HOWTO: Update S32 Design Studio  How to export Generated Code to S32 Design Studio IDE (applicable for MBDT for MPC5744P v2.0)   HOWTO: Install update from 3rd party vendor  S32 Design Studio for Power Architecture v2.1 Migration Guide  HOWTO: Set project optimization level    Troubleshooting Troubleshooting: Issue opening documents from Getting Started page  Troubleshooting: PEmicro Debug Connection: Target Communication Speed  Troubleshooting: Indexer errors on header file  S32 Design Studio Offline activation issue hot fix  Troubleshooting: Installer rolls back immediately following activation code entry  Troubleshooting: Activation fails with error message FNP ERROR 0 
View full article
This example shows how to use EEEPROM without SDK. The example is very similar to this one  Example: S32K144 EEEPROM usage  DFLASH partitioning is done by EEE_Init() function. If the MCU is already partitioned - please check Preserve partitioning for the device checkbox.  - NOTE - there is bug in PE Micro script and this option causes pegdbserver crash.  Target MCU: S32K144 Debugger: OpenSDA
View full article
NOTICE: This may NOT work with the newer versions of PEmicro eclipse plugin (e.g. with S32DS for Power 2017.R1). Please use an alternative way described here:  https://community.nxp.com/thread/486662?commentID=1068206#comment-1068206 This document describes how to program DCF record into UTEST flash with S32DS for Power v1.1+ using PEMICRO Probe (OpenSDA, USB Multilink, USB Multilink FX...) In  S32 Design Studio for Power v1.2+  the Pemicro plugin update step is not required since it's already included so you can skip  Step 1) Step 1) U pdate Pemicro Plugin.  See the post below - it's about ARM version of S32DS but the update process for S32DS for Power is exactly the same. You just need is to select e200 component instead of ARM  error while dubbing: "ERROR loading to the device" Step 2)  Download and extract Flash programming algorithms for MPC5xxx directly from PEMICRO website into your computer. http://www.pemicro.com/downloads/download_file.cfm?download_id=422 Step 3)  Create or reuse an existing S32DS project to connect to the board and inspect the existing content of UTEST/DCF user area memory section. See e.g. MPC5644P example below. Next available address for DCF record of this specific chip is  0x0040_0220 .. 0x0040_0227   Step 3a)  You can export this 64bit free region into a srecord file e.g. MyNewDCF.srec Step 3b)  Adjust Srecord file created to match with DCF record you intend to write. Don't forget to re-calculate Srec checksum. e.g. NOP 0x00000000 00000000   S3 0D 004002200 0000 0000 0000 0000 90 Step 4)  Create/clone an existing debugger configuration that will load DCF into UTEST and adjust its parameters. Step 4a) Change the debugger configuration Name and enter the srecord path + file name adjusted in step 3b) as a C/C++ application. Step 4b) Debugger Tab -> Advanced Options - select Use Alternative Algorithm and browse the location where you extracted flash algorithms at step 2)  E.g. Freescale_MPC5744P_1x32x4k_UTest.pcp Step 4c)  Adjust Startup options - Disable Load Symbols and Run on Reset since this configuration is only for programming DCF record and not for debugging. Step 5) Now press Debug button and it should program your DCF record into UTEST flash memory. After debug session is established you can check if the DCF has been programmed correctly into DCF user area in Memory View. Note: The device will process these DCF records during the system reset sequence before the CPU leaves reset.
View full article
There are situations that require debugging multiple executable files within one debug session. Typical example is debugging the bootloader + application together where each one is a separate executable elf file or S32DS eclipse project. S32DS project loads the debug information of the generated executable file by default. Anyway GDB supports command to add additional elf files debug information into same debug session. If the executable source files are present on the same machine then the source level debugging of all the elf files is possible. Let's assume there are two elf files (bootloader and application) and both are built with debug information enabled - build configuration is named "Debug". Generation of the debug information for GCC compiler could be set in the Project Properties -> C/C++ Build -> Settings -> Standard  S32DS C Compiler -> Debug Level  Each debug configuration in S32 Design Studio supports loading or ignoring debug information. "Load symbols" loads just the debug information whereas "Load executable" basically loads program/code/data sections into MCU memory without debug information. Both options are enabled by default. Before starting the debugger it's necessary to load both executable files into your MCU memory. This could be easily achieved in S32DS (GDB) debug configuration where you specify to add the additional object files. In this specific case we need just 1 additional file - bootloader elf. The bootloader project in this example is actually another project in the same workspace (workspace relative path to elf file entered). After starting debugger the Debugger Console view now shows the details about programming of two elf files instead of one including load address of each section. When loading is finished the debug information for bootloader is not yet available ("No source available..." message displayed in the source level debug view) In order to display source and symbols for the bootloader elf please enter "add-symbol-file"  GDB command into Debugger Console View: add - symbol - file "C:/Users/NXA21306/workspaceS32DS.ARM.2018.R1/s32K144_Bootloader/Debug/s32K144_Bootloader.elf" 0x0000000 ‍‍‍‍ ‍ The GDB client command could be executed automatically when launching a debug session: The first argument is path to the elf file and the second argument (0x00000000) is the load address of the elf file (see the first bootloader load address ). Finally the debug session needs to be refreshed in order to display changes from just added symbol file. The refresh can be forced by performing a single step or issuing the target reset from the debugger.
View full article
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
S32 Design Studio (S32DS) supports Lauterbach Eclipse plug-in to debug S32DS projects via a Lauterbach probe + TRACE32 standalone application. Currently (S32DS Power 1.1, S32DS ARM 1.3) supports "loose coupling" version of the plug-in. This configuration uses Eclipse IDE for development and standalone TRACE32 for debugging.  This plug-in supports the features below: Start TRACE32 from an Eclipse launch configuration Support for multiple projects (multi-core) Synchronization of breakpoints between Eclipse and TRACE32 Open source file’ functionality from TRACE32 to Eclipse and vice versa See the Lauterbach document for additional information about the plug-in. Installation instructions First of all make sure you have TRACE32 installed. Now let's proceed to eclipse plug-in installation. 1. go to menu "Help" -> "Install New Software" and  click on "Add..." button 2. select the Loose Coupling version of component and click "Next" 3. Tick " I Accept the terms of the license agreement" and Select all Lauterbach certificates to trust. 4. Finally you proceed to the installation. When the plugin is installed you will be asked to restart S32DS Now you should be able to create a project with Lauterbach Debugger support: or manage (create, delete, adjust) Lauterbach eclipse debug configurations: Enjoy debugging with TRACE32 Eclipse plug-in in S32DS!
View full article
This document details how to create a new project and build using the existing code and makefile provided within the NXP Vision SDK example projects. If you are creating a new makefile project with code from any other source, the procedure may be different. Before creating a new makefile project from existing code we need to add some paths to the environment variable PATH and a couple of new environment variables. There are 3 main methods for adding these paths and variables. Which method depends upon your needs. Method 1 The paths and variables can be added to each project individually. This is useful if you only want these changes to affect a small number of projects. Or if your projects require different paths and variables. Method 2 The paths and variables can be added to the entire workspace within S32DS . These will not be visible outside of S32DS and therefore will not affect the entire Windows environment. This is useful if you have a large number of projects with common requirements for paths and variables and do not want them visible any tools outside of S32DS. Method 3 The paths and variables can be added globally to the Windows environment and will affect all installed tools. This method is not recommended. Add the following paths to the PATH variable (assuming the default installation settings for S32DS for Vision were used): C:\NXP\S32DS_Vision_v2018.R1\Cross_Tools\gcc-6.3-arm64-eabi\bin C:\NXP\S32DS_Vision_v2018.R1\Cross_Tools\gcc-6.3-arm64-linux\bin C:\NXP\S32DS_Vision_v2018.R1\Cross_Tools\gcc-6.3-arm32-eabi\bin C:\NXP\S32DS_Vision_v2018.R1\utils\msys32\mingw32\bin It is also necessary to add the following Windows system variables: Variable Name: S32V234_SDK_ROOT Variable Value: C:\NXP\S32DS_Vision_v2018.R1\S32DS\s32v234_sdk Variable Name: APU_TOOLS Variable Value: C:\NXP\S32DS_Vision_v2018.R1\S32DS\APUC Now we are ready to create the new project. 1) Launch S32DS for Vision 2) Click New 3) Select 'Makefile Project with Existing Code' 4) Select Next 5) For 'Existing Code Location', select 'Browse...' and then select the directory  C:\NXP\S32DS_Vision_v2018.R1\S32DS\s32v234_sdk\demos\isp\isp_sonyimx224_rgb_yuv_gs8 6) Click OK 7) For 'Toolchain for Indexer Settings', select the option which matches your desired build configuration. Select:    Linux builds: 'Standard S32DS Linux toolchain for ARM Cortex-A'    Standalone builds: 'Standard S32DS toolchain for ARM Cortex-A' This sets up some toolchain paths, but later we will set more for the specific needs of the VSDK examples. 😎 Click Finish 9) Change to C/C++ perspective, click on 'Switch to C/C++ Development' 10) Right-click on the project from the Project Explorer. Select Properties 11) Go to section 'C/C++ Build' and make sure that Generate Makefiles automatically is unchecked:  12) Go to the 'Behavior' tab and in the field next to 'Build', enter:    ISP examples: 'allsub'    APEX examples: 'APU_COMP=nxp allsub' 13) In the field next to 'Clean', enter 'clean' 14) Go to 'Builder Settings' tab, in 'Build location' section change the path for the 'Build directory'. Click on 'Workspace...' button 15) In the Folder selection menu, select the subfolder 'build-v234ce-gnu-linux-d' and click OK 16) Go to section 'Environment' 17) Select the environment variable 'PATH' and click 'Edit...' 18) Add the paths to the value field, each separated by a comma ';' C:\NXP\S32DS_Vision_v2018.R1\Cross_Tools\gcc-6.3-arm64-eabi\bin C:\NXP\S32DS_Vision_v2018.R1\Cross_Tools\gcc-6.3-arm64-linux\bin C:\NXP\S32DS_Vision_v2018.R1\Cross_Tools\gcc-6.3-arm32-eabi\bin C:\NXP\S32DS_Vision_v2018.R1\utils\msys32\mingw32\bin Click OK 19) Click 'Add...' 20) Enter the variable name 'S32V234_SDK_ROOT' and value 'C:\NXP\S32DS_Vision_v2018.R1\S32DS\s32v234_sdk' Click OK 21) Click 'Add...' again and this time enter variable name 'APU_TOOLS' and value ' C:\NXP\S32DS_Vision_v2018.R1\S32DS\APUC' Click OK 22) Click OK to close the Properties menu. 23) Click on 'Build' 24) Once the build is complete, the binary file (ELF) will be created If you like to create release version - add another build configuration and select release build folder. Right click on project name->Properties:  Switch configuration to Release and select build folder:  Exclude release build when Default (you can rename it to Debug) configuration is selected and vice versa.  Right click on Release build folder (that one which ends with -o). Choose Resource configuration and select exclude from build:  Right click on Debug build folder (that one which ends with -d) -> Resource Configuration -> Exclude from build and select Release:  Select Build target to Release and build it: 
View full article
This document describes how to link a binary file(s) with an existing project in S32 Design Studio using GCC build tools. Let's demonstrate this on S32K144 project in S32DS for ARM. Nevertheless it should work with any other GCC based development tools. The first step is to add the binary file(s) into your project folder in the workspace. In the example below I created two binary files "my_bin.bin" and "my_bin2.bin" and added them into a custom folder "bin_files". I also entered 10 characters into each file. my_bin.bin: 0x41 0x41  0x41 0x41 0x41 0x41 0x41 0x41 0x41 0x41  (represents 10 characters "A") my_bin2.bin: 0x42 0x42  0x42 0x42 0x42 0x42 0x42  0x42 0x42 0x42  (represents 10 characters "B") The next step is to modify the linker configuration file (.ld) in order to specify input file format and path to the binary files (see the line 14-17) /* Specify the memory areas */ MEMORY { /* Flash */ m_interrupts ( RX ) : ORIGIN = 0x00000000 , LENGTH = 0x00000400 m_flash_config ( RX ) : ORIGIN = 0x00000400 , LENGTH = 0x00000010 m_text ( RX ) : ORIGIN = 0x00000410 , LENGTH = 0x0007FBF0 /* SRAM_L */ m_data ( RW ) : ORIGIN = 0x1FFF8000 , LENGTH = 0x00008000 /* SRAM_U */ m_data_2 ( RW ) : ORIGIN = 0x20000000 , LENGTH = 0x00007000 } TARGET ( binary ) /* specify the file format of binary file */ INPUT ( . . \bin_files\my_bin . bin ) /* first bin file path (relative to the output folder)*/ INPUT ( . . \bin_files\my_bin2 . bin ) /* second bin file path (relative to the output folder)*/ OUTPUT_FORMAT ( default ) /* restore the out file format */ /* Define output sections */ SECTIONS { . . . ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Finally, i n the SECTIONS block of .ld file specify where to place the binary files (in the example it is placed at the end of .text section - see the line 37,38). /* Define output sections */ SECTIONS { /* The startup code goes first into internal flash */ . interrupts : { __VECTOR_TABLE = . ; __interrupts_start__ = . ; . = ALIGN ( 4 ) ; KEEP ( * ( . isr_vector ) ) /* Startup code */ __interrupts_end__ = . ; . = ALIGN ( 4 ) ; } > m_interrupts . flash_config : { . = ALIGN ( 4 ) ; KEEP ( * ( . FlashConfig ) ) /* Flash Configuration Field (FCF) */ . = ALIGN ( 4 ) ; } > m_flash_config /* The program code and other data goes into internal flash */ . text : { . = ALIGN ( 4 ) ; * ( . text ) /* .text sections (code) */ * ( . text * ) /* .text* sections (code) */ * ( . rodata ) /* .rodata sections (constants, strings, etc.) */ * ( . rodata * ) /* .rodata* sections (constants, strings, etc.) */ * ( . glue_7 ) /* glue arm to thumb code */ * ( . glue_7t ) /* glue thumb to arm code */ * ( . eh_frame ) KEEP ( * ( . init ) ) KEEP ( * ( . fini ) ) . = ALIGN ( 4 ) ; . . \bin_files\my_bin . bin /* First binary file */ . . \bin_files\my_bin2 . bin /* Second binary file */ } > m_text ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ After successful compilation and link let's check map and s-record file (HOWTO: Generate S-Record/Intel HEX/Binary file ) to confirm the binary files have been linked correctly: .glue_7t 0x0000080c 0x0 linker stubs *(.eh_frame) *(.init) *(.fini) 0x0000080c . = ALIGN (0x4) ..\bin_files\my_bin.bin() .data 0x0000080c 0xa ..\bin_files\my_bin.bin 0x0000080c _binary____bin_files_my_bin_bin_start 0x00000816 _binary____bin_files_my_bin_bin_end ..\bin_files\my_bin2.bin() .data 0x00000816 0xa ..\bin_files\my_bin2.bin 0x00000816 _binary____bin_files_my_bin2_bin_start 0x00000820 _binary____bin_files_my_bin2_bin_end .vfp11_veneer 0x00000820 0x0 .vfp11_veneer 0x00000820 0x0 linker stubs‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ If you need a reference to the binary file block start/end address in your code you can use the linker symbols generated automatically or you can define your own symbols in the linker script. /* declare symbols from linker script file */ extern unsigned int _binary____bin_files_my_bin_bin_start ; extern unsigned int _binary____bin_files_my_bin_bin_end ; int main ( void ) { #define COUNTER_LIMIT 100 unsigned int counter = 0 ; unsigned int * bin_start_ptr ; unsigned int * bin_end_ptr ; bin_start_ptr = & _binary____bin_files_my_bin_bin_start ; bin_end_ptr = & _binary____bin_files_my_bin_bin_end ; for ( ; ; ) { counter ++ ; counter = * ( bin_start_ptr ) ; /*loads 0x4141_4141 into counter*/ if ( counter > COUNTER_LIMIT ) { counter = 0 ; } } return 0 ; } ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Note: if it is intended to place the binary file at specific absolute address (e.g. if binary file that represent bootloader) you have to create a separate custom MEMORY and SECTION block in .ld file. /* Specify the memory areas */ MEMORY { /* Flash */ m_bootloader ( RX ) : ORIGIN = 0x001000 , LENGTH = 0x00010000 /* section for bootloadeer*/ m_text ( RX ) : ORIGIN = 0x00011000 , LENGTH = 0x0040000 /*section for application code*/ . . . } TARGET ( binary ) /* specify the file format of binary file */ INPUT ( . . \bin_files\my_booloader . bin ) /* bootloader bin file path (relative to the output folder)*/ OUTPUT_FORMAT ( default ) /* restore the out file format */ /* Define output sections */ SECTIONS { /* place the bootloader binary into 0x0..0x10000 */ . bootloader : { . . \binary_files\my_bootloader . bin /* place the binary file here */ } > m_bootloader . . . ‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ ‍ Enjoy linking binaries in S32 Design Studio!
View full article
Dear S32DS users, S32 Design Studio for Power v1.1 Update 1 has been released.  The Offline update package could be downloaded here:   https://www.nxp.com/webapp/Download?colCode=S32DS_PA_v1.1_UP1&appType=license&location=null&Parent_nodeId=14320533561557…    For online installation please select predefined NXP repository "Help" -> "lnstall New Software..." dialog:  ${p2.metadata.repo.name} - http://www.nxp.com/lgfiles/updates/Eclipse/S32DS_POWER_1_1/com.freescale.s32power.updatesite       The list of changes:  new compiler build 1.1.3 – see details in compiler release notes (attached) MS Visual C++ 2010 Redistributable x86 included for SPT tools for Windows 10 Updated SPT tools: ENGR00381373 - Error build after Generate SPT Fixed ADD, SUB, CMP when destination register is different from src1 ENGR00380758 64 bits operands are not supported for spt2 on windows  Updated Examples  New SPT1 example for MPC5775K o SingleElf_MPC5748G launch files updated with GDB command "set architecture powerpc:vle" Graph Tools ENGR00380255 [SPT] default graph should be created with standard includes Bug fixes: ENGR00375995 MPC5746C Embsys register definitons are missing SPI register set ENGR00379744 SPT assembler shall have initialized 'Include paths (-I) options after MPC577xK or S32R274 project creation ENGR00380796 Linker files section .spt should be corrected for SPT1/SPT2
View full article