This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP432: GCC usage



Dear Everybody,

I'm trying to compile & run a very simple program, for test, using CCS6 and GCC for the MSP432 Launch Pad. The issues are:

- Compiling: two libraries are missed in the default linker configuration "gcc" "nosys", if add them it will compile.

- Run: if you make a very simple program that do really nothing like while(1){ } things seems to work, even if the debugger gives a diagnostic telling you that is unable to copy the Interrupt Vector Table from flash to ram.

But if you try to allocate some memory the program will fall into the Hard Fault Interrupt Service Routine, this I suggest is due an access to a non existent memory area. If You take a look to the map generated by GCC it looks like that the HEAP and STACK segment have a zero length. Looking into the default linker command file msp432p401.lds it seems that there's somenthig missing or wrong but am personally unable to find it out.

Final point is how the Interrupt Vector Table is declared & managed: the TI compiler store the table in RAM relative to END STACK, GCC seems to use a fixed address. At the very end:  the TI doesn't copy the vector table during the initialization but it will be copied the first you call the driverlib routine Interrupt_registerInterrupt(), GCC seems it copy the table before entering main() as You can see in msp432_startup_ccs_gcc.c.

Thanks in advance for Your help. Best Regards

Marco

  • Hello Marco,

    For MSP432 DriverLib GCC support, we actual compiler/build these using command line Makefile and run them using GDB. We use the standard compiler toolchain from https://launchpad.net/gcc-arm-embedded. Using these tools (in a Linux or Cygwin environment) the GCC example projects should compile without issue.

    This being said, there is no reason DriverLib should not also work using the CCS GCC version. Using the latest version of CCS (6.1.0.00104), it looks like the "gcc" and "nosys" libraries are included with the default GCC project.

    I have made a sample project using the DriverLib release MSP432_DriverLib_2_20_00_08. This project simply blinks the LED using the SysTick module. I made it so that the interrupt register is copied to SRAM by using the Interrupt_registerInterrupt function. Everything compiles as expected and the interrupt vector is copied to RAM without issue. You mentioned that in your startup file that the interrupt vector is copied to SRAM- could you attach your startup file? I am not seeing it in the default one included by CCS.

    gcc_driverlib_ccs.zip

    Could you attach your project for reference? Also- could you say which specific version of CCS you are using?

    Best Regards,

  • Hello Timothy,

    thank You for Your answer. I confirm that I using CCSv6 (6.1.0.00104) and Driver Lib 2_20_00_08. I'm sorry but I gave You a wrong information about the startup_gcc.c: the one generated by CCS doesn't make the Interrupt Vector Table copy from Flash to SRAM but if You take a look to the startup files included in the driverlib examples project it seems that they do it. Inside those examples there's also a linker command file named <project_name>_gcc.ld that is totally different from the one used by default msp432p401r.lds. As You immagine all off this is a little bit confusing. I don't know if I right or wrong, but what I have tried to do is to take a project compiled  with the Ti compiler and recompile it with GCC, but as far as I understand from the first part of Your answer thats not the right approach. I attach the project files but the only significant are the config & startup files the main is more than trivial. Sorry but for my ignorance I have troubles inserting the test project.

    I don't know if its the right place to ask You, but in mean time I discovered some over issues. Particularly one: if You run your single PWM example it seems that it change the frequency of the output signal instead of the duty cycle. I have made some test and I probably found the reason why but tell me if you prefer that I open a new thread on this specific argument.

    Finally I know from the communication of your college Katie that there are same silicon issues using the internal temperature sensor, but there's at least something unclear on how to use the Voltage References in this case, same as the previous argument.

    Thanks a lot and take my best wishes.

  • Hello Marco,

    I do see what you mean about the GCC linker script and startup file being out of sync with the generated CCS files. I will put in a ticket to fix this with the latest next release to drive consistency. I will change the DriverLib linker scripts and startup files to match the CCS generated ones.

    As for the PWM example, there is a known issue with that code example being a bit clear. See the following thread:

    In short- the example is a bit misleading in the wording and it is set to be updated to be a bit more clear with the next release. Please read through that thread (in particular my answer) and see if that clears things up. If it doesn't, it might be good to reply to that thread to keep everything organized.

    I'd recommend opening a new thread about the temperature sensor and reference issue in order to get the quickest support.

    Best Regards,

**Attention** This is a public forum