Now, I want to know the start address and length of "_DATA_GROUP_", How can I do it, thanks.
.m51 for the BL51 linker; .map for the LX51 linker.
Neil, thanks for your rapid reply.
After compiling, they can do get from the map file. And I'm sorry for my unclear description, I want to get them in my code, not by looking in the Linker Listing file. About this, how, or can it ?
Thanks very much!
Liu Song.
Why do you want to do this?
I think this may be one of those cases where, if you explained what you're actually trying to achieve, people may be able to offer you better solutions...
I want to save these variables of _DATA_GROUP_ before entering serial_ISR, and so there will be more space for ISR to use.
Maybe there would be a better way to resolve it, so pls give your suggestion, thanks!
And also, I want to know that is it possible to fix the start address and length of _DATA_GROUP_ in code,thanks!
Liu Song
"I want to save these variables of _DATA_GROUP_ before entering serial_ISR, and so there will be more space for ISR to use."
If you save them, they will still occupy space somewhere - so there will not be any overall gain!
Also, the time taken to copy them out at the start of the ISR, and back in again at the end will almost certainly completely kill the performance of your system!
The general idea of ISRs is to keep them as short and simple as possible - doing large memory block moves is certainly the kind of thing that should generally be avoided!
"Maybe there would be a better way to resolve it..."
Almost certainly there is!
"...so pls give your suggestion, thanks!"
It's impossible to make informed suggestions without knowing exactly what it is that you're actually trying to achieve!
You need to explain further why you want to do this - what are you actually trying to achieve?
What is it about your serial ISR that needs so much memory?
Have you looked at the examples for interrupt-driven, ring-buffered serial IO in the downloads section:
http://www.keil.com/download/docs/200.asp http://www.keil.com/download/docs/71.asp
The serial ISR does not need a lot of room for data buffers, since it is only expected to receive and/or transmit a single character - unless you have a chip where the serial port has a built-in FIFO.
However, it isn't the ISR who should process all received data, so if you are trying to get room for a full line of text or similar, you have misunderstood how your ISR is expected to work.
"if you are trying to get room for a full line of text or similar, you have misunderstood how your ISR is expected to work."
The above-mentioned interrupt-driven, ring-buffered serial IO examples would probably serve well in this case...
"The above-mentioned interrupt-driven, ring-buffered serial IO examples have served me well in such cases..."
Yes, ring buffers are very good. But the important thing for the OP to realize is that the ring buffer is static, i.e. isn't allocated when entering an ISR and then released before the ISR ends.
It isn't the ISR that should create a buffer, receive a full line of text and then process, so swapping large sections of memory does not help/work.
A little addendum.
A serial ISR would probably manage with just two 8-bit registers for it's work (plus what is needed for a return address and to protect processor flags).
Either to check the status of the serial port, to compare the read/write positions of a send or receive ring buffer, to pick up one character from a transmit buffer, move the read position one step and put the character in the serial transmit register or pick up one character from the serial receive register put in the receive buffer and step the write position one step.
If the OP feels the need to allocate large areas of memory in the serial ISR, it is quite obvious that a non-optimum solution has been selected.
View all questions in Keil forum