AtmegaS128 Compiler supported by Parasoft

Go To Last Post
17 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi all,

 

I have a C code targeting atmegas128, developed on Atmel Studio and Compiled using AVR-GCC. I wanted to run a dynamic test on that code using Parasoft C++TEST test tool.

The officially supported compilers by Parasoft are listed in This list and AVR-GCC is not existing. is there a supported compiler on which i can compile my code.

 

Any help would be appreciable.

Best Regards.

Aziz.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Parasoft is an independent 3rd party - nothing to do with Microchip - surely Parasoft are the people you need to be asking about this?

 

So have you asked Parasoft?

 

https://www.parasoft.com/company/contacts

 

https://www.parasoft.com/support

 

https://forums.parasoft.com/

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
Last Edited: Tue. Jun 23, 2020 - 11:30 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I asked the Parasoft support team, they told me that Parasoft C++TEST runtime does not support avr-gcc.

That's why i'm looking for another alternative to compile my code.

 

Aziz.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

So why didn't you ask them what compiler(s) it does support for AVR ?

 

They are the ones that are going to know the answer to that question!

 

We can suggest some compilers for AVR - but then you'd just need to go back to Parasoft to them ask if they support them!

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well the first question is whether the code can be mocked/stubbed for building in a different environment? For example it is unlikely any other compiler is going to understand ISR(). When you use something like:

ISR(INT0_vect) {
}

what the C compiler actually sees is:

void __vector_1 (void) __attribute__ ((signal,used, externally_visible)) ; void __vector_1 (void) 
# 4 ".././main.c"
              {

}

so it needs to know what __attribute((signal)) is.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This kind of functions is used in the code, so we need to translate all of these functions to be recognized by some other environment ?

if so, is there a document detailing how to do this translation ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just take a step back and say what your goal here is? Why are you trying to use the Parasoft tool anyway? Maybe there is some other tool that offers a similar job and is more appropriate for AVR? Is this about static code analysis for example?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Using another test tool may be an expensive way and we have already a licence of Parasoft C++TEST tool.

so we need to compile our code with a Parasoft supported compiler to perform Unit testing and Dynamic testing using this tool.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AzizBL wrote:
 we have already a licence of Parasoft

So, surely, you must be entitled to support from Parasoft?

 

So why are you not getting them to help you with this?

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I asked them for other supported compilers for ATmegas128, they told me that they have nothing for AVR, that's why I'm looking here for another compiler.

but if we try to take the following post as a starting point, can we compile our code with a Paraoft supported compiler like GCC 5.X ?

 

clawson wrote:

Well the first question is whether the code can be mocked/stubbed for building in a different environment? For example it is unlikely any other compiler is going to understand ISR(). When you use something like:

ISR(INT0_vect) {
}

what the C compiler actually sees is:

void __vector_1 (void) __attribute__ ((signal,used, externally_visible)) ; void __vector_1 (void) 
# 4 ".././main.c"
              {

}

so it needs to know what __attribute((signal)) is.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AzizBL wrote:
to perform Unit testing and Dynamic testing
But most of what you do in micro code is based on the operation of the peripherals. So how do you "mock"/simulate those for unit test anyway?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will see if we can perform the unit test but i think the dynamic test can be performed.

so is there how to compile my code using a different compiler ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

According to the Parasoft list you linked to, there is no support for the AVR. Choose a different microcontroller that is supported.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks to me that the test tool does not understand language extensions that are there to interact with hardware, eg ISRs. So to use the test tool you will need to rewrite your code to remove, or seriously modify, those elements. Which kind of defeats the object of testing as you'll no longer be testing the production code.

 

I suspect the way to do it would be to write a complete HAL (Hardware Abstraction Layer) which splits out anything to do with the hardware from the mainline code. For testing you then write a test HAL, which you will need to validate against the real one, and do your testing using that. The real HAL will then need testing using other methods to ensure that it behaves as expected.

 

Start with your design documents and see where the split occurs.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman wrote:
According to the Parasoft list you linked to, there is no support for the AVR.

Indeed.

 

So why did you choose Parasoft?

 

Choose a different microcontroller that is supported.

Or choose a different tool - one which does support the target(s) you need!

 

There was a thread on unit-testing embedded code recently:

 

https://www.avrfreaks.net/forum/how-simulate-serial-port-atmel-studio

 

and there have been plenty before that.

 

It is a standard problem.

 

From the list, it is clear that Parasoft do support some small microcontrollers - HC08, HC12, C166, MSP430, 8051, etc - so they must understand the issues and should be able to guide you, have examples, etc ...

 

have you checked out their resources:

 

Tips and information about improving your software development processes.

https://www.parasoft.com/resources

 

Unit Testing on Host and Target for C and C++ Applications

With Parasoft C/C++test’s complete framework for unit testing, developers get everything they need to create, execute, and maintain tests. Integrating with leading IDEs, Parasoft C/C++test’s unit testing features include multi-metric code coverage analysis, a powerful stubbing and C mocking framework, and automated cross-platform execution. These features are easy to use, reduce the burden of implementing the unit testing framework, and improve developers' productivity.

https://www.parasoft.com/ctest/unit-testing

 

Perhaps one of their "partners" can help you:  https://www.parasoft.com/partners

 

 

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

His argument seemed to be "we paid for Parasoft so we're jolly well going to use it!". As such the solution would seem to be to use a micro that they support.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Microchip says

 

Customers can start with the industrial version using the ATmega128 MCU or the Space Version ATme-gaS128 device as both share the same pinout

So software wise like it must be just like the old fashioned M128?? It has the same pinout anyway.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly