Page 1 of 1

problem with master and ADC block

Posted: Thu Dec 18, 2008 11:36 am
by crh
Hello Lubin,
I started some time ago with microcontrollers.
I rebuild your first model with the compare block and compiled it. No problems.
Now, I try to compile a model with a master block and an ADC block.
In the error screen I received the following message:

Code: Select all

Error building Real-Time Workshop target for block diagram 'BCwithBPfilter'. MATLAB error message: Error using ==> genMakefileAndBuild at 1070
  Error(s) encountered while building model "BCwithBPfilter"

And in the Matlab workspace at the end:
BCwithBPfilter.o: Link Error: Could not allocate section .nbss, size = 13522 bytes, attributes = bss near  Link Error: Could not allocate data memory gmake: *** [..\../BCwithBPfilter.coff] Error 255 
### Real-Time Workshop build procedure for model: 'BCwithBPfilter' aborted due to an error.
C30 Compiler found
I suppose there are some mismatches in the settings of the block parameters. I tried to attach the mdl file, but I received the message: size too big.
Kind regards, Casparus

Re: problem with master and ADC block

Posted: Thu Dec 18, 2008 1:49 pm
by LubinKerhuel
Hi Casparus,

I just increased the max upload size from 256Ko to 2 Mo. You shoudl be able to upload your file now.

If you just have an ADC block with a Master block, there is a problem !

I guess that you implement a filter. If you are using a FIR filter, you may have too many coefficients.
go to Configuration ==> options parameters ==> Optimization == > check "inline paramemters". That may uses less RAM memory.

Lubin

Re: problem with master and ADC block

Posted: Thu Dec 18, 2008 4:15 pm
by crh
Hello Lubin,
I cannot believe myself, but now I managed to compile. But the process takes an extreme long time. I do not know if this is a normal situation for models with a filter.
I uploaded my model in the attachment.
I am very busy to study the filters. So far, as I understand fixed filters are using less space. But, I still wonder if there are some common problems (with the use of an ADC and gain block)to implement them in dsPic30F43013.
For fewer coefficients I already checked the box: inline parameters. I did this already yesterday. For this, I used the model adviser, a very useful and easy tool.
Kind regards, Casparus

Re: problem with master and ADC block

Posted: Sun Jan 11, 2009 6:58 am
by malife
Hello All,
This problem, which really is not a problem but a compiler feature is related with near and far code (data and code) take a look at the C30 compiler documentation so you can set the flags accordingly in the compiler settings in matlab. I've been through this error before.

Regarding the long compilation time, if you are using dsp blocks in matlab the first time you compile takes a very long time since it is generating object files for many functions even if you do not use them directly. The second time around should be much faster. If not you might have some setting wrong.

Hope this helps.

Re: problem with master and ADC block

Posted: Thu Jan 15, 2009 8:32 am
by crh
Hello Lubin,

Everything is clear now. Thanks for your help,

regards, Casparus