Skip to content

ww21.4 Intermediate Release #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
May 21, 2015
Merged

ww21.4 Intermediate Release #4

merged 9 commits into from
May 21, 2015

Conversation

climberhunt
Copy link

Work in progress.
Added cfw, basic serial funcs (read() write() )
Arc init code, interrupt code, timer code.

David Hunt added 9 commits May 19, 2015 11:48
Adding analogWriteResolution and analogReadResolution

Signed-off-by: Dan O'Donovan <[email protected]>
Signed-off-by: David Hunt <[email protected]>
Author: Dan O'Donovan <[email protected]>
Date:   Fri May 15 14:46:08 2015 +0100

Framework code extracted from the following commit ID in
Intel's thunderdome git repo: 8b198659675cd820072bdeb00d0c5de87c6f6ee2

This brings the necessary library code into the source tree, but not
yet integrated in the Arduino run-time environment (to follow shortly).

Signed-off-by: Dan O'Donovan <[email protected]>
Signed-off-by: David Hunt <[email protected]>
Intial release of serial functionality, Serial.write, print, println, read
Also added files required, Ringbuffer (not used yet), Print, etc.
Also some small changes to make Intel toolchain work, still more work needed.

Signed-off-by: David Hunt <[email protected]>
A first draft for the following functions:
    * delay()
    * millis();
    * micros();
Not yet implemented:
    * delayMicroseconds.

Author: Bogdan Pricop <[email protected]>

Signed-off-by: Bogdan Pricop <[email protected]>
Signed-off-by: David Hunt <[email protected]>
Interrupt handling - add hw context saving

* Disable instruction cache (we don't need it at this stage)
* Setup automatic (hardware) context saving feature for non-fast
  interrupts.
* Set optimization to none (-O0) in Makefile.

build: Eliminating compiler warnings

Fix interrupt handling bug

    Issue:
        A simple blink sketch having a 10 ms delay between blinks crashed
        after a few seconds.
        It looks like the stack got corrupted.
    Root cause:
        The generic assembly hardware ISR, "_do_isr", was not properly
        written; the "sp" was not properly handled.
    Solution:
        Replace the assembly hardware ISR with a C function having
        "__attribute__((interrupt("ilink")))"

    Note:
        We need this generic hardware ISR because the IVT is in flash and
        we cannot change it at runtime.

Allocating more SRAM to ARC (syncing with latest Thunderdome mem allocation)

build: Removing sdata section declaration from linker scripts

    ARC doesn't support an SDATA section bigger than 1024 bytes, and
    we overflow this too easily when we link in code that hasn't been
    compiled with the -mno-sdata compiler flag.  So we will ensure that
    we only use code compiled with -mno-sdata (including standard C lib)
    and we remove this section declaration to weed out any exceptions to this.
    In other words, if we link any code that tries to use the sdata section,
    we will see a linker error.

build: Adding HEAP section

    Adding heap section with start/end marker symbols to satisfy
    malloc() and friends

Signed-off-by: David Hunt <[email protected]>
final cleanup before push. no functional changes.
small cleanup around interrupt init code.

Signed-off-by: David Hunt <[email protected]>
* Fix delay() issue
        Issue: If value of microsecond is Timer0 limit, arcv2_timer0_count_get()
        microseconds condition will always be true, spinning for ever.
        The main issue is that the time between 2 consecutive readings of
        COUNT0 register is around 90 ticks and the Timer may overflow
        before the next reafing of COUNT0 if last values read > LIMIT - 90.
        Fix: Take in consideration the number of overflows. If TIMER0 overflows
        just leave the loop (even if COUNT0 < microseconds)
* Restructure a bit arcv2_timer0_enable() function in order to reflect the
      procedure described in chapter 3.3.76.1 of DesignWare ARCv2 ISA
      Programmer's Reference Manual.
      Make sure Timer0 initialisation clears the counter register as well.
* code review - added yield via hooks.c
* added back in strip stage when building
* Remove unused code in os.h, os_types.h and pf_init.h
* Uncomment call to yield() from delay() Arduino function; yield() is
      added for sake of compatibility.
* Remove dead code from timer0 init function.
* Commented out enable instruction cache
* Added Copyright header to wiring.c
* Setup automatic (hardware) context saving feature for non-fast interrupts
* Serial Communication API Initial checkin of Serial.read() and Serial.write()
  using header pins 0 and 1
* Eliminated some compiler warnings.

Signed-off-by: David Hunt <[email protected]>
Cleaning up after code reviews and validation of build.

Signed-off-by: David Hunt <[email protected]>
@calvinatintel
Copy link
Contributor

You can update the pull request with new commits by updating your master branch

@calvinatintel
Copy link
Contributor

Is this ready to be reviewed?

@calvinatintel
Copy link
Contributor

Is this in pair with this PR? https://github.com/01org/Arduino.json/pull/1

@calvinatintel
Copy link
Contributor

It might not work if it's in pair with this PR: #4

@manoelramonintel
Copy link
Contributor

@calvinatintel ready for cherry-pick... let's see if compiles

@calvinatintel calvinatintel merged commit 07a494f into arduino:master May 21, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants