logo elektroda
logo elektroda
X
logo elektroda
REKLAMA
REKLAMA
Adblock/uBlockOrigin/AdGuard mogą powodować znikanie niektórych postów z powodu nowej reguły.

Kompilacja wsadu do Atmegi32a - sterownik akwarium, błąd inicjacji LCD

Zielenkiewicz 03 Lis 2014 12:50 1143 7
REKLAMA
  • #1 14097893
    Zielenkiewicz
    Poziom 11  
    Posty: 16
    Ocena: 9
    Mam taki problem z kompilacja. Buduje sterownik do akwarium. Wsad do atmegi32 otrzymałem gotowy, wraz z plikami źródłowymi.

    Niestety wyświetlacz ,który posiadam, jest minimalnie inny. Musiałem zmienić kilka linijek kodu.
    Według instrukcji znalezionej na tej stronie http://hobby.abxyz.bplaced.net/index.php?pid=3&aid=10 Gdy próbowałem uruchomić ten wyświetlacz z wgranym do Atmegi32 wsadem z powyższej strony, okazało się ,że są dwa typy tych wyświetlaczy.

    Ale znalazłem rozwiązanie, problem leżał w różnicach inicjacji LCD . Wiem co zmienić i z programem, ze strony powyżej, mój LCD od Nokia 3310 działa. Wszystko się kompiluje ok.

    Ale jak chcę zrobić to samo, z programem do sterownika akwarium, nie chce się skompilować.


    Wywala coś takiego.

    MacBook-Piotr-Zielenkiewicz-2:aqa Piotr$ make

    -------- begin --------
    avr-gcc (GCC) 4.1.1
    Copyright (C) 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


    Compiling: nokia.c
    avr-gcc -c -mmcu=atmega32 -I. -gstabs -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=nokia.lst -std=gnu99 -MD -MP -MF .dep/nokia.o.d nokia.c -o nokia.o
    nokia.c:22:20: error: avr\io.h: No such file or directory
    In file included from global.h:41,
    from nokia.c:23:
    /usr/local/bin/../lib/gcc/avr/4.1.1/../../../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
    make: *** [nokia.o] Error 1
    MacBook-Piotr-Zielenkiewicz-2:aqa Piotr$

    Nie wiem czy dobrze rozumiem, ale domyślam się, że brakuje jakiś bibliotek.

    kompiluje na MacBook OSX 10.6.8

    Wsad do sterownika akwarium i schematy pobrałem stąd. http://ep.com.pl/Archiwum/2008/Wrzesie%C5%84.html
    sterownik akwariowy
  • REKLAMA
  • #2 14098211
    vonar
    Poziom 28  
    Posty: 690
    Pomógł: 151
    Ocena: 30
    To
    Cytat:
    nokia.c:22:20: error: avr\io.h: No such file or directory
    w zestawieniu z tym
    Zielenkiewicz napisał:
    kompiluje na MacBook OSX [...]

    wyjaśnia wszystko...
  • REKLAMA
  • #3 14098333
    Zielenkiewicz
    Poziom 11  
    Posty: 16
    Ocena: 9
    Wiem że jej chyba nie widzi
    #include <avr/io.h>.
    Podczas kompilacji wsadu do sterownika akwarium,
    ale jest też dołączana do piliku, z którym wcześniej odpalałem ten wyświetlacz.

    I tam nie ma problemu z kompilacją. Powinna być wiec w bibliotece.
  • #4 14098357
    vonar
    Poziom 28  
    Posty: 690
    Pomógł: 151
    Ocena: 30
    Ty możesz nie dostrzegać różnicy między / i \, jednak to nie zmienia faktu, że prawidłowym separatorem w Twoim systemie jest /, a w linii 22 pliku lcd.c znajduje się \...
  • REKLAMA
  • #5 14098862
    Zielenkiewicz
    Poziom 11  
    Posty: 16
    Ocena: 9
    Tak masz rację poprawiłem, ale to tylko otwiera puszkę pandory.
    przestarzały nagłówek <avr/interrupt.h>
    wgrać starsze biblioteki?



    -------- begin --------
    avr-gcc (GCC) 4.1.1
    Copyright (C) 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


    Compiling: menu.c
    avr-gcc -c -mmcu=atmega32 -I. -gdwarf-2 -DF_CPU=8000000UL -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-adhlns=menu.lst -std=gnu99 -MD -MP -MF .dep/menu.o.d menu.c -o menu.o
    In file included from global.h:41,
    from menu.c:3:
    /usr/local/bin/../lib/gcc/avr/4.1.1/../../../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
    menu.c: In function 'frame_main':
    menu.c:208: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:226: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:238: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c: In function 'frame_data_time':
    menu.c:488: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:499: error: invalid lvalue in assignment
    menu.c: In function 'frame_programm_function':
    menu.c:565: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:575: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c: In function 'frame_f_thermostat':
    menu.c:1344: error: invalid lvalue in assignment
    menu.c: In function 'frame_f_air_1':
    menu.c:1425: error: invalid lvalue in assignment
    menu.c: In function 'frame_f_air_2':
    menu.c:1494: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:1496: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:1522: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:1524: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:1620: error: invalid lvalue in assignment
    menu.c: In function 'frame_f_feeding':
    menu.c:1739: error: invalid lvalue in assignment
    menu.c: In function 'frame_timer':
    menu.c:1795: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:1797: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:1813: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:1819: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:1839: error: invalid lvalue in assignment
    menu.c: In function 'frame_f_reffiling':
    menu.c:1911: error: invalid lvalue in assignment
    menu.c: In function 'frame_light_1':
    menu.c:2033: error: invalid lvalue in assignment
    menu.c: In function 'frame_light_2':
    menu.c:2230: error: invalid lvalue in assignment
    menu.c: In function 'frame_light_3':
    menu.c:2307: error: invalid lvalue in assignment
    menu.c: In function 'frame_measuring_ph_option':
    menu.c:2423: error: invalid lvalue in assignment
    menu.c: In function 'frame_zone3_option_prog':
    menu.c:2570: warning: pointer targets in passing argument 2 of 'LcdStr' differ in signedness
    menu.c:2621: error: invalid lvalue in assignment
    menu.c: In function 'frame_night_light_option_prog':
    menu.c:2731: error: invalid lvalue in assignment
    menu.c: In function 'frame_fan':
    menu.c:2875: error: invalid lvalue in assignment
    make: *** [menu.o] Error 1
    MacBook-Piotr-Zielenkiewicz-2:aqa Piotr$
  • REKLAMA
  • #6 14099348
    vonar
    Poziom 28  
    Posty: 690
    Pomógł: 151
    Ocena: 30
    Wykonaj w katalogu ze źródłami:
    Kod: Bash
    Zaloguj się, aby zobaczyć kod


    Po tym powinno przynajmniej dać się skompilować menu.c...
  • #7 14100334
    Zielenkiewicz
    Poziom 11  
    Posty: 16
    Ocena: 9
    Po tym jest tak.



    MacBook-Piotr-Zielenkiewicz-2:demo Piotr$ cd aqa
    MacBook-Piotr-Zielenkiewicz-2:aqa Piotr$ make

    -------- begin --------
    avr-gcc (GCC) 4.1.1
    Copyright (C) 2006 Free Software Foundation, Inc.
    This is free software; see the source for copying conditions. There is NO
    warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


    Size before:
    main.elf :
    section size addr
    .text 32854 0
    .data 28 8388704
    .bss 852 8388732
    .stab 72732 0
    .stabstr 30912 0
    Total 137378




    Creating load file for EEPROM: main.eep
    avr-objcopy -j .eeprom --set-section-flags=.eeprom="alloc,load" \
    --change-section-lma .eeprom=0 -O ihex main.elf main.eep
    avr-objcopy: there are no sections to be copied!
    avr-objcopy: --change-section-lma .eeprom=0x00000000 never used
    make: [main.eep] Error 1 (ignored)

    Converting to AVR Extended COFF: main.cof
    avr-objcopy --debugging --change-section-address .data-0x800000 --change-section-address .bss-0x800000 --change-section-address .noinit-0x800000 --change-section-address .eeprom-0x810000 -O coff-ext-avr main.elf main.cof
    Warning: file /var/folders/dd/ddbwLOY9GJmjZdcz7J8jAU+++TM/-Tmp-//cclDc75g.s not found in symbol table, ignoring
    Warning: ignoring function __vectors() outside any compilation unit
    Warning: ignoring function __bad_interrupt() outside any compilation unit
    Warning: file /var/folders/dd/ddbwLOY9GJmjZdcz7J8jAU+++TM/-Tmp-//cc4teyt7.s not found in symbol table, ignoring
    Warning: file /var/folders/dd/ddbwLOY9GJmjZdcz7J8jAU+++TM/-Tmp-//ccdi0pQx.s not found in symbol table, ignoring
    Warning: file /var/folders/dd/ddbwLOY9GJmjZdcz7J8jAU+++TM/-Tmp-//ccaYBNpT.s not found in symbol table, ignoring
    Warning: file /var/folders/dd/ddbwLOY9GJmjZdcz7J8jAU+++TM/-Tmp-//ccPvYUoT.s not found in symbol table, ignoring
    Warning: file /var/folders/dd/ddbwLOY9GJmjZdcz7J8jAU+++TM/-Tmp-//ccoHzwbI.s not found in symbol table, ignoring
    avr-objcopy: --change-section-vma .eeprom+0xff7f0000 never used
    avr-objcopy: --change-section-lma .eeprom+0xff7f0000 never used
    avr-objcopy: --change-section-vma .noinit+0xff800000 never used
    avr-objcopy: --change-section-lma .noinit+0xff800000 never used

    Size after:
    main.elf :
    section size addr
    .text 32854 0
    .data 28 8388704
    .bss 852 8388732
    .stab 72732 0
    .stabstr 30912 0
    Total 137378



    -------- end --------

    MacBook-Piotr-Zielenkiewicz-2:aqa Piotr$





    przy okazji oryginalnie był kompilowany przy pomocy popularnego kompilatora avr–gcc (GCC) wersja 3.4.3 i był debugowany za pomocą AVRStudio 4.12
  • #8 14100729
    vonar
    Poziom 28  
    Posty: 690
    Pomógł: 151
    Ocena: 30
    Kompiluje się, o to chyba chodziło?

    Inna sprawa, że ten program nie zmieści się w pamięci M32...
    Wyczyściłeś projekt przed kompilacją?

Podsumowanie tematu

✨ Użytkownik napotkał problemy z kompilacją wsadu do mikrokontrolera Atmega32a, który ma być użyty w sterowniku akwarium. Po modyfikacji kodu źródłowego, aby dostosować go do innego wyświetlacza LCD, użytkownik zauważył, że występują różnice w inicjacji LCD, co udało się rozwiązać. Mimo to, podczas kompilacji kodu do sterownika akwarium pojawiły się błędy związane z przestarzałymi nagłówkami oraz różnicami w separatorach w ścieżkach plików. Użytkownicy zasugerowali poprawki w kodzie oraz sprawdzenie, czy projekt został wyczyszczony przed kompilacją, co mogło wpłynąć na problemy z pamięcią mikrokontrolera.
Wygenerowane przez model językowy.
REKLAMA