After you have typed out the above c program to your main.c file,You can compile the C file by pressing F7 key or by going to ' Project -> Build Target ' on the IDE menu bar.
Uploading hex code is specific to the 8051 derivative you are using.For example some microcontrollers like P89V51 and Nuvoton W78E05D have build in boot loader which can upload hex code through their serial port.
My C code has an ISR, where a decision has to be made to execute a particular function "A". Now I know that its not good to run a function in an ISR. But in this case of my application, I do not see another way out. After calling the function "A", I noticed a sudden jump in the Data Consumed size and the sudden WARNING L15 explained in KEIL EXPLANATION OF WARNING.
I am certain that function "A" is not executed in a reentrant fashion, but it sure uses up physical memory; both function "A" as well as functions it calls. (This I believe refers to the variables declared in the functions).
Secondly, I want to apply the method 2 as shown in the keil explanation. But I do not know how & where exactly to insert the OVERLAY directive in my code. At initialization? At function Declaration? Before Function definition? Where exactly?
Please understand that with Keil on 8051 cores that the subroutine's local variables and any entry arguments beyond what would fit into registers the compiler allocates RAM for the placement of these. The linker then has a complicated job that it does to analyze the full calling tree structure of your program and optimize the pool of memory allocated for these purposes so as to minimize the amount of RAM required. This minimization uses mutual exclusion between code calling sequences to determine what parts of the memory pool can be shared between code paths that do not overlap in the execution flow.
When you inject an ISR call into the mix of the code calling tree the linker cannot determine from what point the interrupt may come into play. It could come at any time during any one of the mutual exclusion paths that the linker found in the normal mainline code. This means that the linker has to pull the subroutine out of the shared usage pool and allocate data space specifically for the subroutine local variables and maybe even some of its entry arguments. Without this the shared memory pools from other mutually exclusive code execution paths would get polluted and the program would crash in blazing glory.
The challenge when coding on an 8051 core is try to steer away from designs that use lots of local variables, have lots of entry arguments and have calling contexts that are shared between mainline code and interrupts. You really have to limit the freedoms that you get with other architectures that have a stack that gets used for subroutine argument passing and local variables. Keil chose to not implement everything on the stack and thus produced a tool set that offers performance and optimization that is first class in the industry for 8051 architecture. And for that reason it is important to adapt a coding style that plays into the Keil scheme.
In your case I really recommend that you reconsider your determination that this subroutine has to be called from both the mainline context and the interrupt context. Try to find a design technique that avoids this and your life will be a lot simpler.
The OVERLAY directive is a command to the linker, and it does not go into your source code at all. You can place directives on the BL51 command line, but for anything nontrivial, it is usually better to put then into a separate linker command file and pass that file to the linker using the BL51 @ syntax on the command line.
If you agree that a lot of people work with Keil, and others work with IAR, even if IAR provides the best solution, I don't think it is such a good idea to bind EVERY customer to the solution that appears to you the best. Let them choose. The drawback will be to support (more or less) both compiler. But, if you provide just the minimum information to run the code with the Keil compiler, it will be a good point. No need to support it completely. Let the community work for you. A lot of us are already using a full paid software, with a full paid services, and full paid support hardware, software, legacy code, habits ... we need to change just for this product.
The solution you seems to prefer, the evaluation period is so much useless! 4kB of code, even during 60 days are nothing. Just the Zigbee stack could full it, letting too few space for user code. And moreover, who needs only 60 days for "evaluation"?
I am backing the other user when he said that you are not providing a free code. You are just driving your customers to buy IAR. That's not an advantage from the TI products compared with others more versatile compiler-speaking.
What do you think about just helping customers choosing the solution they prefer? It need just to be more specific how to set up their compiler of choice. And if possible, share your own findings for KEIL or other well-known ones.
Good point. It would be great if TI could support Keil, IAR, CCE, SDCC, mspgcc, etc. This is not the case. Z-Stack and TIMAC is currently bundled with IAR EW430 or IAR EW8051. If mesh networking is the only networking option you are looking for IAR is the way to go.
TI do provide other options where the source sample code is provided. With these options you can select your compiler of choice if interested. Multiple software examples are provided in source for multiple CCxxx and can be build for Keil, CCE - Code Composer, mspgcc, or sdcc. It is up to you.
you can in fact use Keil with all our 8051 SoC devices. TI has made a distributable for Keil Vision which is released and supported by Keil. This distributable contains the necessary debug plug-ins which enable using the Keil IDE for both code development and debugging of the second generation SoCs. For more information, see
LPWRocks : "TI do provide other options where the source sample code is provided." Is it possible to support academic research with this kind of options or is it reserved only for high price buyers? And what implies the "sample" part?
Interesting discussion! We are also working for years with KEIL for our 8051 derivatives. Now we need to go RF, so after some study we end up with TI/CHipcon's CC2430 as an ideal solution (still focus on the competition however). But then, there was this IAR environment ONLY (and indeed too expensive) which is a pitty. From TI, we heard that they experimented with KEIL but 'the outcome' wasn't successful???
But, from this forum, there seem to be some possibilities, although I wander? Did anyone actually used KEIL for some SIMPLICITI (probably that doable!) or better, some ZIGBEE2006 stack application? It would be perfect indeed, despite differences in optimization issues for now?!? Anyway, I'm thinking what to do next?
I, like many others like to start by adapting examples given by manufacturers and IAR is the way to go with the CC's and the smart rf04. I think if you spend quite a lot of money on a development kit you should be able to develop for longer than 60 days with it!
For example, SimpliciTI is provide as source code, so feel free to build it with your IDE and compiler of choice for your preferred LPW transceiver or LPW RF SoC solution.
From a TI perspective with MSP430 + LPW, CCE is actutally the most interesting option to explore
This is exactly one of the reasons I'm looking hard at TI for a low-power wireless design (MSP430 + CC2500). I want to use Rowley's CrossStudio & my wireless needs are pretty basic - perfectly handled by SimpliciTi & the 2500 - so this is a viable solution. If Simpliciti was tied to a toolset or just provided as libraries (as opposed to source), I'd be looking at other solutions.
P.S. I might give CCE v3 a shot down the road - I had fun (sarcasm on) with CC v2 working on a C54xx DSP project & that made me gun shy. The compiler & debugger were fine, but the memory mapping utility (a bit more complex on a DSP) was frightful & complicated. Then on forums & boards people calling CCE things like "Code Contorter" doesn't make me any more comfortable. Never used CCE for the MSP430 though in all fairness. The price is attractive and the free version is pretty generous.
No I didn't port SimpliciTI to CCE3 .... the 2 main IDEs I've been using are IAR & Rowley.... I like IAR's interface more, to me it is cleaner & more intuitive... Rowley seems to be over-the-top with inheritance & details (e.g. to debug, you must first "attach to a target" and then "start debugging") - for such a straightforward uC family, the Rowley CrossStudio IDE seems to be a bit overly-complicated, but the price is more reasonable than IAR and it seems to have the same capabilities.
CCE3 might be the best of both worlds, but I'm a little "gun shy" after using CCv2 on the DSP side (that was 4 years ago and a different processor family, so maybe that's not a fair comparison to make)
Also maybe you can confirm this - I believe at MSP430 Day a few months back the instructor indicated that not only do you get 2x the project code size with the free version of CCE3 (compared to IAR), but also it compiles/builds IAR projects "out of the box", at least mostly.
I hope I can provide some comparative benchmarks pretty soon. Fortunately it's pretty easy to move code between the 2 toolsets. Most code examples come "pre-packaged" for IAR, but Rowley's intrinsics are very similar & they have a header file that makes the porting almost brain-dead easy.
I think this is more of an 8051 tool chain issue... Everyone has their preferred compiler... other than convenience and cost, what does the Keil compiler offer that the IAR compiler doesn't? Note that the Keil compiler doesn't come cheap either. I believe the licensing fees are comparable to IAR's. On the 2430, since it has more than 64K of flash, this requires code banking support, and I've heard in order to support code banking with Keil, this becomes a very manual and tedius process, meaning you have to have put a compiler directive in front of every function or groups of functions in order to get optimized code. Does anyone have any user experience with the Keil code banking support? Would be interested in any lessons learned etc. Thanks in advance.
c80f0f1006