1 / 54

Wouter van Ooijen Mail: wouter@voti.nl Sheets en info: voti.nl/hvu/2TPRJ8 voti.nl/hvu/arm

hardware en ontwikkelomgeving voor 2TPRJ8. Wouter van Ooijen Mail: wouter@voti.nl Sheets en info: www.voti.nl/hvu/2TPRJ8 www.voti.nl/hvu/arm. onderwerpen. het ARM bordje de fiets DevEnv – opstarten, editen, compileren debuggen met Insight downloaden met OCD Commander het BSP

step
Télécharger la présentation

Wouter van Ooijen Mail: wouter@voti.nl Sheets en info: voti.nl/hvu/2TPRJ8 voti.nl/hvu/arm

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. hardware en ontwikkelomgeving voor 2TPRJ8 Wouter van Ooijen Mail: wouter@voti.nl Sheets en info: www.voti.nl/hvu/2TPRJ8 www.voti.nl/hvu/arm Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  2. onderwerpen • het ARM bordje • de fiets • DevEnv – opstarten, editen, compileren • debuggen met Insight • downloaden met OCD Commander • het BSP • opdrachten Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  3. het ARM bordje • Philips ARM2106 microcontroller (64k RAM, 128k FLASH) • voeding uit USB (maar geen USB communicatie) • LCD 2x16 char (HD44780-compatible) • klein luidsprekertje • 16 schakelaars, uitlezen via 2 x HC165 schuifregisters • 8 LEDjes, aansturen via 1 x HC595 schuifregister • parallel JTAG programming interface (McGraigor Wiggler compatibel) • RS232 serial interface • connector voor uitbreidingen http://www.voti/nl/hvu/arm Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  4. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  5. LPC2106 (ARM chip) Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  6. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  7. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  8. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  9. de fiets • snelheidsregeling voor een LEGO motortje • aansluiting van een hall (= magneet) sensor Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  10. de fiets Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  11. DevEnv • PSPAD editor • GNU assmbler/C/C++ compiler • Insight debugger • MAC_MOT TCP-to-parallel JTAG interface Los: • OCD Commander, Philips flash tool • C++ BSP/RTOS Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  12. DevEnv • installeer de files uit de BSP (BikeComputer.zip?) • in een lege directory • let op: geen spaties in de pathname  • dubbel-klik op de .ppr file Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  13. DevEnv PsPad editor met GNU tools voor ARM asm/C/C++ ontwikkeling Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  14. DevEnv build foutmeldingen Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  15. DevEnv Als je dit krijgt bij het linken heb je debugger/loader niet afgesloten Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  16. Voorlopig werken jullie uitsluitend in RAM. De microcontroller heeft 64Kb RAM, maar daar moet alles in: code, globale data, stack. Wees dus “een beetje” zunig. Downloaden met de de JTAG debugger gaat niet erg snel. Zuinig zijn met code werkt dus sneller! Een klasse op zich kost geen code, maar (klasse) variabelen en (klasse) functies wel! Downloaden met de OCD Commander gaat veel sneller, maar je kan dan nauelijks debuggen. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  17. sluit het bordje aan (USB + parallel) Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  18. Dit is de setting voor JTAG Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  19. Insight debugger • start debugger Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  20. Insight debugger zet onder file > target settings: • Target = Remote/TCP • Hostname = 127.0.0.1 • Port = 8888 (als je netjes afsluit blijft zou dit moeten blijven staan) Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  21. Insight debugger run > download Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  22. Insight debugger Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  23. Insight debugger continue Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  24. Insight debugger als het goed is kom je nu op het breakpoint aan het begin van main Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  25. Insight debugger Je kan breakpoints toevoegen of verwijderen (ook in andere source files) Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  26. Insight debugger Je kan variabelen (en andere lijsten) bekijken Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  27. Insight debugger Je kan regel voor regel het programma uitvoeren Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  28. Insight debugger continue Zoals het een embedded programma betaamt eindigt ons programma nooit. stop Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  29. Insight debugger Na een ‘stop’ zit je meestal ergens in assembler Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  30. loader : OCD commander start de OCD Commander Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  31. loader : OCD commander check Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  32. loader : OCD commander Load file Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  33. loader : OCD commander Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  34. loader : OCD commander Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  35. loader : OCD commander run Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  36. loader : OCD commander Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  37. loader : OCD commander Halt Voor je weer kan laden Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  38. MAC_MOT Als je dit krijgt moet je dat ding installeren / starten. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  39. MAC_MOT Als je dit thuis krijgt kan je onder control panel > system > hardware > device manager (select view > show hidden devices) > non plug-and-pray devices > MAC_MOT > driver instellen op status = started, type = automatic Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  40. MAC_MOT  Als de thuis die MAC_MOT driver niet kan vinden: installeer de Macraigor OCD commander (de link staat op www.voti.nl/hvu/arm) Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  41. troubles...  Als het echt niet werkt: de USB aansluiting er even uithalen om het bordje te resetten, evt ook je PC resetten. Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  42. class C_BSP { public: // get the one and only BSP: static C_BSP * getInstance( void ); C_Busy * busy; C_Interrupts * interrupts; C_Timer0 * timer0; C_Timer1 * timer1; C_Pins * pins; C_Beeper * beeper; C_LEDs * leds; C_Keyboard * keyboard; C_LCD * lcd; private: . . . Chip On-board peripherals Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  43. class C_Busy { public: // wait n microseconds void waitUs( int n ); // wait n milliseconds void waitMs( int n ); private: . . . Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  44. class C_Interrupts { public: // Check whether interrupts are currently enabled. bool isEnabled( void ); // guards for an region of code that must run uninterruptable // these calls work properly when nested void unInterruptableBegin( void ); void unInterruptableEnd( void ); // check the current nesting of uninterruptable regions // probably usefull for debugging int unInterruptableCount( void ); private: ... Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  45. class C_Timer { public: // abstract methodes: virtual unsigned long getMillisec( void ) = 0; virtual void registerCallback( void (* cb)( void ) ) = 0; protected: . . . Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  46. class C_Timer0 : public C_Timer { // C_Timer1 is similar public: // The registered function is called on each timer interrupt // Registering another function overwrites the previous. // N.B. The function cb() should not do any I/O write operations // neither directly nor indirectly! void registerCallback( void (* cb)( void ) ); // static member for the routines to call if the timer ticks static void (* callback)( void ); // handler called when timer interrupt occurs static void timerInterruptHandler0 (void); // static member for the number of milliseconds static unsigned long nrMillis; inline unsigned long getMillisec( void ){ return nrMillis; } // clock frequency static const unsigned CLOCK_FREQ; private: . . . Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  47. enum DirectionT { DirectionInput, DirectionOutput }; class C_Pins { public: // set the direction of a pin void setDirection( unsigned char pin, DirectionT direction ); // get and set pin value // set is usefull when the pin direction is output // get is usefull when the pin direction is input bool get( unsigned char pin ); void set( unsigned char pin, bool value ); private: . . . Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  48. class C_Beeper { public: // switch the Beeper on (== high) void on( void ); // switch the Beeper off (== low) void off( void ); private: . . . Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  49. class C_LEDs { public: // set the LEDs according to the 8 bits in value void setAll( unsigned char value ); // switch the LED nr on or off void setOne( unsigned char nr, bool value ); private: . . . Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

  50. enum KeyT { Key0 = 6, Key1 = 15, Key2 = 14, Key3 = 13, Key4 = 12, Key5 = 11, Key6 = 10, Key7 = 9, Key8 = 8, Key9 = 7, KeyA = 3, KeyB = 2, KeyC = 1, KeyD = 0, KeyStar = 5, KeySharp = 4, KeyNone = 0xFF }; class C_Keyboard { public: // read the keyboard, return // whether a key is pressed // and if so which one KeyT read( void ); private: . . . Hogeschool van Utrecht / Institute for Computer, Communication and Media Technology

More Related