Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] Porting lwbt to FreeRTOS

Status
Not open for further replies.

Elderflower14

Junior Member level 3
Joined
Aug 18, 2011
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,486
Hi Back Again,

I am trying to port lwbt to FreeRTOS and use that on MSP430. I am currently using CCS v4.2.4. So as the first step I ported FreeRtos for MSP430 CCS Ide. Then I tried to include lwbt files in FreeRTOS. I added the files directly under the Demo Source folder for RTOSDemo for MSP430F5438. Now after removing all the compiler errors, I get the below linking errors which I am unable to decipher.

Linking>
error: symbol "write" redefined: first defined in
"./Demo_Source/printf-stdarg.obj"; redefined in "C:\Program Files\Texas
Instruments\ccsv4\tools\compiler\msp430\lib\rts430xl.lib<lowlev.obj>"
"../lnk_msp430f5438a.cmd", line 105: error: run placement fails for object
".bss", size 0x5607 (page 0). Available ranges:
RAM size: 0x4000 unused: 0x3dac max hole: 0x3dac
error: errors encountered during linking; "RTOSDemo.out" not built

Any pointers will be highly apprecitated.

Cheers
 

You appear to have possibly two separate errors.

The first error:

error: symbol "write" redefined: first defined in
"./Demo_Source/printf-stdarg.obj"; redefined in "C:\Program Files\Texas
Instruments\ccsv4\tools\compiler\msp430\lib\rts430 xl.lib<lowlev.obj>"
"../lnk_msp430f5438a.cmd",

the symbol "write" is used in both printf-stdarg.obj and lowley.obj of the xl.lib. Take a look at available sources from which these object files were derived for conflicting uses of the "write".

The second error:

line 105: error: run placement fails for object
".bss", size 0x5607 (page 0). Available ranges:
RAM size: 0x4000 unused: 0x3dac max hole: 0x3dac

Indicates the bss section of the data segment is to large to fit in the available Data RAM. The bss section contains the statically allocated variables, variables external to any function declaration or variables declared with the "static" keyword.

You'll need to look at your available Data RAM resources and well as your memory map and see if you can increase bss section by decreasing or move other sections. Another possible solution is to move any unnecessary EXTERN variables declarations internal to the routines you are utilizing these variables.

BigDog
 

Hi Bigdog,

I have couple of questions.

1) I ported lwbt by adding the files under the Demo_Source folder for FreeRTOS port of MSP430 demo application. Is this correct way of porting?
2) As you suggested I looked into the file print-stdarg.c and it had a write function which didn't do much but the comment was "to keep linker happy". I commented the write function and the link error is gone now.
3) Finally the data segment error,how do i look into the available Data RAM resources and memory map.

Thanks.
 

What Data RAM resources does your MSP430 have?

You can find this information in the devices datasheet.

Reference, MSP430F5438A Datasheet, pg 2, Table 1. Family Members:

According to the table you have 16K SRAM or 0x4000 SRAM, which supports the linker message:

error: run placement fails for object
".bss", size 0x5607 (page 0). Available ranges:
RAM size: 0x4000 unused: 0x3dac max hole: 0x3dac

Out of the 0x4000, the max hole is 0x3dac, this is the largest continuous unused portion.

I suspect the LWBT stack is requiring the largest portion of the required size 0x5607, protocol stacks can be quite storage intensive.

You'll have to reduce a large amount of the Bluetooth stack storage requirements, in fact it looks like it might be a slash and burn operation.

I don't have any experience with that particular stack, although requested heap sizes and lookup tables are normally one of the issues with protocol stacks in general. I would look around for any other ports to similar MCUs and see if the individual who ported the LWBT can give you some insight.

I ran a quick search and found this comment:

LWBT is suitable for use in embedded systems with tens of kilobytes of free RAM and room for around 40 kilobytes of code ROM.

Also here is a discussion concerning a port of LWBT to a PIC24:

PIC24FJ64GB002 with Bluetooth USB dongle

As I indicated above, slash and burn operation. You may have to roll your own Bluetooth Stack, using LWBT as a template and the feature list bare to the bones.


BigDog
 

Hi BigDog,

Thanks for the advice. The combination of FreeRTOS and Lwbt is taking up about 22k of memory. So either I have to do my own port of lwbt to MSP430 or as you said roll my own Bluetooth stack using lwbt as a template. Going forward I am looking to port lwbt to MSP430 without FreeRTOS. I am sure to hit roadblocks whiles porting and will definitely be back in the forum asking for help and advice. Many thanks.

Cheers
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top