Jump to content
43oh

Rickta59

Members
  • Content Count

    1,135
  • Joined

  • Last visited

  • Days Won

    71

Everything posted by Rickta59

  1. https://github.com/energia/Energia/blob/master/hardware/msp430/cores/msp430/main.cpp You might check your function name
  2. I noticed that if you use the TI arm compiler in CCS 6.x you can easily run code from ram. Unfortunately, it doesn't seem like they have implemented that for the arm-none-eabi-gcc compiler. Attached is a zip file project you can import into CCS. It is configured to run the msp432 at 48MHz using the high frequency crystal. It is also configured to generate small code using the nano.specs newlib configuration. In the default linker script, the data segment uses all the available ram starting at the base address of 0x20000000. The msp432 provides another bus address for SRAM at the base
  3. If you really want to do serial coding you should pick a different launchpad. The g2 launchpad board is probably the worst of the bunch. The launchpad serial port is limited to 9600 baud, even though the chips themselves can go higher.
  4. You are right @@cooldoubtless, it is broken. It looks like some recent ( or at least since the last time I looked .. which was years ) checkin into the source code has broken the TimerSerial code. The msp430g2231 and msp430g2452 use TimerSerial as Serial because they lack a uart. This requires that the pins used are the one from the timer_a. The TimerSerial code also needs to work with the 1.4 launchpad boards as they had no simple way to change the rx and tx assignments. The change below is what I did to make it work for only the msp430g2452 and msp430g2231: $ git diff diff --git a/
  5. The g2452 has to use a software only uart implementation the pins shouldn't go the other way
  6. If you moved the stack so that it occupies the lower end of ram, and pushed up the .bss and .data sections you could allocate a fixed stack that could throw an exception if it exceeded its limits. See this article http://embeddedgurus.com/state-space/2014/02/are-we-shooting-ourselves-in-the-foot-with-stack-overflow/ and find the section called 'A Smarter Way' http://embeddedgurus.com/state-space/files/2014/02/fig3.jpg This approach would be best used during development and not during production. You could easily have two ld scripts, one setup for development and one setup for relea
  7. I came across this the other day. I had issues on linux too. I was able to get it to appear by wiping out my $HOME/.ti directory and deleting the gcc 5 binary. Yes drastic but once I did that, then I could download the gcc 5 again and it worked properly. Note: wiping out your .ti directory is probably a bad idea
  8. Doesn't using BSL without a password end up wiping out the info segment where the factory calibrated settings are stored? This might have been an msp430g series only issue. I remember there was a reason I didn't like BSL. I think that was it. My memory is foggy on this, and I looked unsuccessfully to see if i could find the info. [edit] ... actually I found it http://www.ti.com/lit/ug/slau319k/slau319k.pdf#page=6 ...
  9. I've got the msp430-elf-gcc version working properly now in the latest checkin https://gist.github.com/RickKimball/3173f5ca73bc6dcdb7bc Turns out that I got lucky with msp430-gcc. I had forgot to add a "RETI" instruction in the WDT ISR. The only reason it worked with msp430-gcc was the default exception handler had ended up in flash right after the WDT ISR. The default exception handler just does a "RETI" so it just happened to work. I also added a msp430fr5969 specific version that uses the FRAM for stack space. This frees you of the limits of RAM and allows for larger stacks and m
  10. I like the idea of the JTAG mailbox. @@jazz Does that mean I have to use a host side program to interface to jtag or can it be used like a normal cdc device? I guess your solution implies use of your sbw+ jtag device.
  11. I've been spending way too much time looking at this thing. So thanks for that. I did some timing testing with the msp430g2553 running at 8MHz, it seems like it takes about 8 to 10 microseconds to do the context switch. There is some overhead, however I was able to compensate for extra cycles by over clocking the DCO. On the msp430g2553, I made the slight change to increase the DCO clock: BCSCTL1 = CALBC1_8MHZ; // Set DCO to factory calibrated 8MHz DCOCTL = CALDCO_8MHZ; DCOCTL += 13; // overclock 103% or 8.22MHzSpeeding it up this m
  12. I just pushed the changes .. take another look at the gist repo. https://gist.github.com/RickKimball/3173f5ca73bc6dcdb7bc#file-main-c-L27 -rick
  13. msp430-gcc can do ok too : ) . I used the -ffix-reg feature to generate some optimized switcher code: //============= TASK SWITCHER ISR ============= __attribute__((interrupt(WDT_VECTOR), naked, used)) void taskswitcher(void); void taskswitcher(void) { 4576: 04 41 mov r1, r4 4578: 34 52 add #8, r4 ;r2 As==11 #ifdef __MSP430_HAS_MSP430XV2_CPU__ __asm__ volatile ("pushm #9,r15"); 457a: 8f 15 pushm #9, r15 "push R11\n push R10\n push R9\n push R8\n" "push R7\n" ); #endif ++systick;
  14. ah .. you are only talking about the code after and before the push .. ok well gcc isn't that bad then
  15. I ported the code over to msp430-gcc 4.6.3. I did change some things around: Most ints are changed to unsigned int, otherwise msp430-gcc will generate sign extension asm instructions each time you touch them. I made the taskrun a volatile so it actually works with gcc __task is replaced with the equivalent gcc __attribute__() directives I moved some of the stack variables in main to ".bss" so you get the whole stack ... * otherwise you lose a couple of words gcc generates better code for ints than char so those are replaced I changed the WDT to tick at 1ms interval to make a systick easier a
  16. It would be interesting to the see what code your IAR compiler is producing. msp430-gcc is more like 48 words for the taskswitch routine.
  17. I've been playing around with this under msp430-gcc. I've got it working pretty well however, I had to make a bunch of changes to make ms430-gcc happy. Unfortunately, I've not been successful getting this to work with msp430-elf-gcc. It seems that the way it uses the stack and ABI aren't playing nicely with this code. I added a systick and sys_delay feature. To make my life simpler, I have the WDT ticking every 1ms running at 8MHz. As soon as we here back from @@tonyp12 I'll post the code. -rick
  18. @@tonyp12 what license are you releasing this under?
  19. Thanks, the stack size thing seemed arbitrary to me, and I was wondering why. task1 and task2 don't use any stack space. So I was wondering why you bothered to give them any stack beyond the 14 words.
  20. Can you explain why you are using 28 and 24 for the task stack sizes? Why do you back up the magic # of -26 -rick
  21. This is interesting stuff, nice post! I took a quick stab at getting this to compile on msp430-gcc. I replaced the __task and __raw with the gcc naked attribute. It gives you warnings but looking at the code it seems to do the right thing. Thanks, -rick $ diff common.txt common.h 3a4 > #define __task __attribute__((naked)) 8a10 > $ diff main.txt main.c 20c20 < int* multistack = (int*) __get_SP_register(); --- > int* multistack = (int*) __read_stack_pointer(); 35,36c35,36 < #pragma vector = WDT_VECTOR < __raw __interrupt void taskswitcher(void) --- > __a
  22. For msp430 topics, there are users in #43oh channel on freenode.net. http://webchat.freenode.net/?channels=43oh&nick=guest_from_post ... replace the nick with a better one if you like
  23. I have some of the same feelings zeke. What I've done is to only dole out information in real time using IRC. This allows me to gauge who is looking for the information and why. If it is for commercial use I just ignore them. If it is a lazy student, I especially ignore them. If it someone like me, just looking to find out the information for their own benefit, I share freely. -rick
×
×
  • Create New...