1
\$\begingroup\$

I'm programming a MSP430f6638 via JTAG interface, specifically i'm using TS430PZ100USB kit, and I'm trying to write a FAT16 file in an SDCard so I'm using the FatFs modules to make the system file, the thing is that this module has a couple nested functions, so when i initialize the project i realize the stack has reached its full capacity which (according to IAR Workbench) is only 160 bytes long, when I check the datasheet I can't find exactly the capacity of the stack but RAM is 16kB long, is divided in four sections of 4kB so the top section should be the one where I can find the stack, I don't think an MSP430 has such a small stack, this a common enough high level application. If anyone could give me an answer.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ Stack size is set in the .xcl file. Have you tried changing it? \$\endgroup\$ Commented Dec 23, 2015 at 19:30
  • \$\begingroup\$ Thanks, i just found the .xcl, i did'nt know i couls do so, i'll give it a try, i hope that works \$\endgroup\$
    – Iliover
    Commented Dec 24, 2015 at 15:17

1 Answer 1

1
\$\begingroup\$

My answer is very general with respect to these devices, I have more experience with the 8051, which also has a very small stack (128 or 256 bytes). I would always write the code with a maximum of only 1 deep into the call stack. Is it possible for you to re-write your code to accomplish this? The compiler can try and inline your call stack, but this doesn't always work.

\$\endgroup\$
1
  • 2
    \$\begingroup\$ That is not possible with a reasonable and maintainable FAT implementation. Its just too complex. \$\endgroup\$
    – Turbo J
    Commented Dec 24, 2015 at 2:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.