Skip to content

msp430: Add newlib support#6445

Closed
justinjoy wants to merge 2 commits intoRIOT-OS:masterfrom
justinjoy:pr/msp430-newlib
Closed

msp430: Add newlib support#6445
justinjoy wants to merge 2 commits intoRIOT-OS:masterfrom
justinjoy:pr/msp430-newlib

Conversation

@justinjoy
Copy link
Copy Markdown

This PR is made based on #4766. I rebased and took some commits from the original PR and they are little squashed, and some of them aren't used.
Unlike the original PR, I tend to use ldscripts from TI without changes.

Although I can build successfully, there are two issues. Please refer to the log below.

  • Command not found is shown when starting build process, but I failed to find exact point of that.
  • As we talked in IRC, the generated hex is too large for hello-world. (29Kb)
$ make BOARD=msb-430
make: command: Command not found
Building application "hello-world" for "msb-430" with MCU "msp430fxyz".

"make" -C /home/joykim/iot/RIOT/boards/msb-430
"make" -C /home/joykim/iot/RIOT/boards/msb-430-common
"make" -C /home/joykim/iot/RIOT/boards/msb-430-common/drivers
"make" -C /home/joykim/iot/RIOT/core
"make" -C /home/joykim/iot/RIOT/cpu/msp430fxyz
"make" -C /home/joykim/iot/RIOT/cpu/msp430_common
"make" -C /home/joykim/iot/RIOT/cpu/msp430fxyz/periph
"make" -C /home/joykim/iot/RIOT/drivers
"make" -C /home/joykim/iot/RIOT/drivers/periph_common
"make" -C /home/joykim/iot/RIOT/sys
"make" -C /home/joykim/iot/RIOT/sys/auto_init
"make" -C /home/joykim/iot/RIOT/sys/isrpipe
"make" -C /home/joykim/iot/RIOT/sys/newlib
"make" -C /home/joykim/iot/RIOT/sys/oneway-malloc
"make" -C /home/joykim/iot/RIOT/sys/tsrb
"make" -C /home/joykim/iot/RIOT/sys/uart_stdio
   text    data     bss     dec     hex filename
  10193     274    1074   11541    2d15 /home/joykim/iot/RIOT/examples/hello-world/bin/msb-430/hello-world.elf

@OlegHahm OlegHahm self-assigned this Jan 20, 2017
@OlegHahm OlegHahm added Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation Platform: MSP Platform: This PR/issue effects MSP-based platforms labels Jan 20, 2017
Joakim Nohlgård and others added 2 commits March 22, 2017 09:44
The ldscripts(1.194) from official TI website[0]
don't define `eheap` and `sheap`. These variables
are required to get heap pointer, but allocation
from heap seems not to be used currently.
Therefore, DISABLE_HEAP_ALLOC is added to enable or
disable `_sbrk_r` function by selection until we are
sure that newlib for msp430 is verified.

[0] http://www.ti.com/tool/MSP430-GCC-OPENSOURCE

Signed-off-by: Justin Kim <justin.kim@collabora.com>
@justinjoy
Copy link
Copy Markdown
Author

Rebase onto master, and fix make: command: Command not found error.

@justinjoy
Copy link
Copy Markdown
Author

Slight update about size problem.

I investigated the differences between newlib which TI provides and locally compiled one.
Because TI's newlib seems to be optimized to reduce size. However, the gain is less than 2kb for same board and same application (tested on MSB-430, and hello-world).

@aabadie
Copy link
Copy Markdown
Contributor

aabadie commented Jun 20, 2017

ping, needs rebase btw.

@aabadie aabadie added this to the Release 2017.07 milestone Jun 23, 2017
@miri64
Copy link
Copy Markdown
Member

miri64 commented Nov 21, 2017

How's this going along?

@tcschmidt
Copy link
Copy Markdown
Member

@OlegHahm like to finish review?

@tcschmidt
Copy link
Copy Markdown
Member

@jcarrano It seems @OlegHahm is in power save - do you mind taking up the review?

# upstream GCC msp430 port (sometimes referred to as the Red Hat MSP430
# compiler) is usually accompanied by newlib.
# The new msp430 port started with version 4.9.x, the latest release of the old
# mspgcc is 4.6.3 from the beginning of 2012 and doesn't look like it will receive
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason why we would want to support a compiler which has not been updated for 6 years and most likely won't receive any fix ever again?


# use the nano-specs of Newlib when available
ifeq ($(shell $(LINK) -specs=nano.specs -E - 2>/dev/null >/dev/null </dev/null ; echo $$?),0)
export LINKFLAGS += -specs=nano.specs -lc -lnosys
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't think here is the right place to put these options. See #9281 and the PRs it mentions.

ifeq (1,$(MSP430_USE_NEWLIB))

# Temporarily disabled memory allocation from heap
export CFLAGS += -DDISABLE_HEAP_ALLOC
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this do and why is it needed?

while(1);
}

#ifndef DISABLE_HEAP_ALLOC
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of this file is a bit different in thew current RIOT. Could you rebase? There is already a test for sbrk.

@tcschmidt
Copy link
Copy Markdown
Member

@justinjoy ping

@justinjoy
Copy link
Copy Markdown
Author

@justinjoy ping

I took a quick look the merge conflict, but I found my PR is too old to fix it in a simple way.
And, I don't have msp430 environment currently. I wish someone else could take this if it's urgent.

@tcschmidt
Copy link
Copy Markdown
Member

@haukepetersen @miri64 @kYc0o is there interest to support this board? Or shall we just close?

@tcschmidt
Copy link
Copy Markdown
Member

Closed due to lack of momentum.

@tcschmidt tcschmidt closed this Jun 19, 2018
@kYc0o
Copy link
Copy Markdown
Contributor

kYc0o commented Jun 26, 2018

I just want to add the memo label since I'd really like to work on it.

@kYc0o kYc0o added the State: archived State: The PR has been archived for possible future re-adaptation label Jun 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Platform: MSP Platform: This PR/issue effects MSP-based platforms State: archived State: The PR has been archived for possible future re-adaptation Type: enhancement The issue suggests enhanceable parts / The PR enhances parts of the codebase / documentation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants