Processor Expert.. where to applay?

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

Processor Expert.. where to applay?

Jump to solution
2,022 Views
grzegorzK
Contributor III

Dear

 

I would like to ask community: what kind of project you apply Processor Expert code?

I mean commercial high quality firmware or only to test or academic use or whatever?

 

I reflect the answer what I get from FreeScale support about problem with compilation code generated of Processor Expert. I get answer with conclusion:

 

 

"Using ProcessorExpert is useful for fast and simple application or peripheral driver develops. But we lose the advantage of full control for codes/project settings. But if we need full control on code or project is more complex, my recommendation is not use ProcessorExpert."

 

What I really do not understand. Is it mean that is not worth to consider in commercial because not fully supported? or not supported at all? My project is not complex, but I was not able to compile one C module generated by Processor Expert. Nothing special.

 

Best Regards

/Greg

0 Kudos
1 Solution
1,559 Views
ProcessorExpert
Senior Contributor III

Hi,

 

Regarding the optimizations issue - the problem with software optimization is that if they are used with hardware dependent code like Processor Expert generated code, the result may not be 100% correct. Optimizations could for example change order of writes into some bits or put together writes into two bits that need to be separate.

 

Processor Expert code is tested and we guarantee functionality with the compiler settings that the project is created with. So, changing optimization settings should be done very carefully and on the user's own risk and in some cases it leads to an error when the user tries to change them because Processor Expert requires a specific option directly in the code.

 

However, I agree that this not very clear from errors reported and should be at least better documented (now it's only mentioned in Processor Expert help that the -Onf option isued), we'll try to improve that for the next release.

 

Regarding the support - Processor Expert is a fully supported product, you should get all assistance you need when you submit a Service Request ticket. Jim already mentioned we have many customers that use Processor Expert for professional development and I can confirm that. You canot expect that PE produces a completely optimized drivers for any type of an application as it's a general rapid application development tool, however from my experience, it highly accerates the project creation once you get into the basics.

 

best regards
Petr Hradsky
Processor Expert Support Team

View solution in original post

0 Kudos
11 Replies
1,559 Views
jimtrudeau
Senior Contributor I

Greg,

 

I know the support person, they are good, but I'm not happy with the answer you got, so we'll use this as a learning opportunity. A couple of things, real quick.

 

I'm eager to hear from the community on this, so I'm all ears. But I'll be on PTO for a few days, so I'll check back into this thread when I'm back. From the "inside" I can tell you we have very high end commercial customers using Processor Expert software on very complex projects.

 

 I looked into your SR, and IMHO the problem you encountered should be investigated as a potential defect. That's what the support person and I will chat about. The generated code should work at any optimization level and not cause a compiler error. It's possible that something you did elsewhere caused a glitch, one never knows. But it merits investigation.

0 Kudos
1,559 Views
grzegorzK
Contributor III

JimTrudeau wrote:

Greg,

 

I know the support person, they are good, but I'm not happy with the answer you got, so we'll use this as a learning opportunity. A couple of things, real quick.

 

I'm eager to hear from the community on this, so I'm all ears. But I'll be on PTO for a few days, so I'll check back into this thread when I'm back. From the "inside" I can tell you we have very high end commercial customers using Processor Expert software on very complex projects.

 

 I looked into your SR, and IMHO the problem you encountered should be investigated as a potential defect. That's what the support person and I will chat about. The generated code should work at any optimization level and not cause a compiler error. It's possible that something you did elsewhere caused a glitch, one never knows. But it merits investigation.


Jim:

 

I absolutly agree with you, especially that error is not really big issue and any impact for me! propably is easy to correct, 

however I always report such problems becouse it still error and I want to feel that someone really support me and I can rely on such support any time. Thanks.

 

Error is easy to reproduce: just use wizard and try to add some extra level of optimization using "smart sliders".

I am sure it may be easy fixed. Just ask compiler team about compilation option, I work with HC12 compiler very short but as I read from manual for compiler  option -Onf an -ot maybe such conditional pragma may be a solution, ask compiler provider.

 

#if defined(__OPTIMIZE_FOR_TIME__)
#pragma OPTION ADD "-Onf" 
#endif

 

 

Regards

/Greg

0 Kudos
1,560 Views
ProcessorExpert
Senior Contributor III

Hi,

 

Regarding the optimizations issue - the problem with software optimization is that if they are used with hardware dependent code like Processor Expert generated code, the result may not be 100% correct. Optimizations could for example change order of writes into some bits or put together writes into two bits that need to be separate.

 

Processor Expert code is tested and we guarantee functionality with the compiler settings that the project is created with. So, changing optimization settings should be done very carefully and on the user's own risk and in some cases it leads to an error when the user tries to change them because Processor Expert requires a specific option directly in the code.

 

However, I agree that this not very clear from errors reported and should be at least better documented (now it's only mentioned in Processor Expert help that the -Onf option isued), we'll try to improve that for the next release.

 

Regarding the support - Processor Expert is a fully supported product, you should get all assistance you need when you submit a Service Request ticket. Jim already mentioned we have many customers that use Processor Expert for professional development and I can confirm that. You canot expect that PE produces a completely optimized drivers for any type of an application as it's a general rapid application development tool, however from my experience, it highly accerates the project creation once you get into the basics.

 

best regards
Petr Hradsky
Processor Expert Support Team

0 Kudos
1,559 Views
grzegorzK
Contributor III

Hi Petr

 

 

Thank you for your answer, I think I understand (or try to understand). I have plenty experience with most of cross compilers in industry and work close with compiler’s vendor. I always inform about every single smallest inconsistent or bug, because I expect high quality Ansi C compiler with full or almost full compliant with Ansi C standard. Indeed compilers sometimes produce wrong code when you use high level optimization, but if you do not open bug, compiler vendor will not fix it. I understand that “hardware depend code” what you mention is not such obvious, however we also write such code (outside Processor Expert) and now I am really, really worried that there is some problems with compiler…

 

From your answer I understand that:

 

1)FreeScale compiler is not Ansi C compliant (?) I change order of bits write. It is very bad and I want to know about suchsituationbecause it is possible impact in code write by me.

 

or

 

2)FreeScale code is not written correctly (intentionally or not, do not matter for me?) Compiler has full freedom to change writeorder(bits, bytes, words, whatever) if software engineer allow on it, of course if such optimization is allowed by Ansi C standard!Ansi Cstandard provide possibility to limit optimization but it is out of topic.

 

I do not care case 2) but feel free to ask a help or assistance, I have wide experience in this topic.

But if  true is 1) case I want you to isolate problem and make pressure on compiler vendor in order to fix it. If such feature in compiler is intentionally, I need want to know about it, it has big impact on our products.

If you do not want to do this, please just isolate problem and send it to me, I will do pressure on compiler vendor. It is not make sense for me to use compiler with bugs in commercial use, to big risk for my company and my customers.

I would like to investigate problem further. Please provide questionable source code, it is very important to know about bugs in compiler.

 

Best Regards

/Grzegorz Konopko

Imotive.pl

0 Kudos
1,559 Views
ProcessorExpert
Senior Contributor III

Hi,

 

Thank you for your feedback. 

I'd like to state that I'm probably not a best preson to discuss compiler details with as I'm not a compiler expert so if you would like to discuss the compiler in detail I recommend to use compiler forum or submit a service request for that.

 

I just wanted to say that some apects of machine code produced by the compiler may change according to the optimization options set and we are testing generated code using default optimization options.

 

Anyway, I have done some investigation and checked the details regargind the mentioned optimization option (-Onf) with the developers and got the following information. There are two reasons why the CPU component module forces off the optimization for Creating Sub-Functions with Common Code" :

 

- In cpu.c component module, there is a function _EntryPoint that is called first after Reset. This function does a very basic setup of the hardware (cpu clock and memory setup etc.) and it also configures a stack pointer (SP) to a proper value. Becase the SP is not ready yet, calling any routine (that may result from these optimization on) would crash the CPU.

 

- Second reason is that the compiler reports warning (Warning : C12056: SP debug info incorrect because of optimization or inline assembler), that disappears if optimization  is off.

 

best regards
Petr Hradsky
Processor Expert Support Team


 

 

 

 

 

 

0 Kudos
1,559 Views
grzegorzK
Contributor III

Hi Petr

 

Thank for your answer, I think we are moving forward. As I already wrote: my aim is to get know about all bugs in my environment, specially in PE and S12 compiler so I will not abandon this thread before I will get know all risk in my development in order to decide what next. This knowledge is important, is better to use more buggy compiler with knowledge about bugs, than use almost "perfect" compiler without knowelage.

 

First of all I do not understand why you do not open bug ticket about wrong behavior of compiler? If you do not do this, I will because finally we need to make decision in my company: do we still use FreeScale compiler or looking other compiler vendor for S12.

 

I have a look in to Cpu.c as you point me and from my understanding of C environment there is serious bug: see attachment (screenshot from executing debugger with S12XET256). There is at least 1! Line of C code executed without proper set SP. Stack pointer is reset to 0 what I do not think is proper value. Even if you do not call any subroutine from my understanding executing C code is serious violation. In my practice I have never seen such situation, I understand that compiler has freedom to use as many stack memory as decide and user should not rely of it’s own understanding how compiler should execute code. Please investigate and inform me about progress and possibly risk in using processor expert and S12 compiler. I will try to be in touch with compilers team in order to improve my aim (get knowledge about all knowing bugs).

 

Best Regards

/Grzegorz Konopko

Imotive.pl

0 Kudos
1,559 Views
ProcessorExpert
Senior Contributor III

I'm sorry, but this seems to be a misunderstanding. This is not a compiler issue. As I wrote, the _EntryPoint function is a first code that runs after reset before any of C runtime initialization is done. It's a special low-level code that configures the CPU clock to be correctly running etc. SP is not needed as there is no function call here and there are special pragmas that disable generation of code surrounging normal C fuinctions. The _EntryPoint contains just macros writing into CPU registers.

 

Regaring the compiler, I will ask people who can give you more direct support for you compiler questions to get in touch with you directly if you'd like.

 

best regards
Petr Hradsky
Processor Expert Support Team


0 Kudos
1,559 Views
grzegorzK
Contributor III
Hi Petr
 
1. From my understanding is a bug, because compiler is still free to use some kind of optimization, behavior may change in next version of compiler. Speciall case is use other compiler for such code, it is ANSI C code so there should no be limitation to compile with other compilator.
2.  It od not resolve root problem what is: impossible to use smart sliders with processor expert code.


 

Regaring the compiler, I will ask people who can give you more direct support for you compiler questions to get in touch with you directly if you'd like.

 





 

Yes, I wouldk like directly support. 

 

Thanks 

/Greg

0 Kudos
1,559 Views
grzegorzK
Contributor III

added project ProcessorExpert_CPU_c.zip what mentioned in ticket (Service Request) 1-803418376.


0 Kudos
1,559 Views
ProcessorExpert
Senior Contributor III

I agree that smart sliders cannot be freely used with Processor Expert. It's currently the limitation that can be workarounded only by manually disabling "Create Sub-Function with Common Code" optimization option in the global compiler settings. This can be done in  Project settings dialog / Target / Compiler for HC12 by unchecking the checkbox in Options dialog in "Optimizations" page or by directly removing "-Of" option from commandline.

I am passing this a request for improvement to the compiler team to improve handling of the optimization settings conflicts.

 

 

best regards
Petr Hradsky
Processor Expert Support Team


 

 

0 Kudos
1,559 Views
grzegorzK
Contributor III

Thank you

 

Waiting on upgrade of PE.

 

/Greg

0 Kudos