einige Fragen zu 24HJ256GP610-IPT

OP #1526551
Lesenswert?

Hallo,
habe jetzt eine Variable(Array) im Ram angelegt.

#define max_table_funktion_memory 256

l_table_funktion_memory table_funktion_memory[max_table_funktion_memory] 
=
{
{0,0,0}    //  -->>
};

typedef struct _L_TABLE_FUNKTION_MEMORY
{
unsigned char *pAdr; // Pointer
byte Codex;
byte Bit;
} l_table_funktion_memory;

solange max_table_funktion_memory nicht größer 256 ist, funktionert es.

wenn größer, dann Fehlermeldung
memory.o: Link Error: Could not allocate section .nbss, size = 310 
bytes, attributes = bss near
Link Error: Could not allocate data memory

Gruß Siegfried
OP #1526563
Lesenswert?

Hallo,
a) Controller
#if (defined(_PIC24HJ256GP610_))
#include <p24Hxxxx.h>
#else
#error  "PIC-TYP ist nicht richtig!"
#endif // #ifdef (lots of PIC24H devices)

b) wenn wert nicht größer 256

Program Memory  [Origin = 0x200, Length = 0x2aa00]

section       address   length (PC units)   length (bytes) (dec)
-------       -------   -----------------   --------------------
.text         0x200                0x90            0xd8  (216)
.const        0x290              0x1d00          0x2b80  (11136)
.dinit        0x1f90               0xe20          0x1530  (5424)
.text         0x2db0               0x6b2           0xa0b  (2571)
.isr          0x3462                 0x2             0x3  (3)

Total program memory used (bytes):         0x4b96  (19350) 7%


Data Memory  [Origin = 0x800, Length = 0x4000]

section   address      alignment gaps    total length  (dec)
-------   -------      --------------    -------------------
.ndata    0x800                   0          0x1500  (5376)
.nbss     0x1d00                   0           0x136  (310)
.ndata    0x1e36                   0             0x8  (8)
.nbss     0x1e3e                   0             0x2  (2)

Total data memory used (bytes):         0x1640  (5696) 34%


Dynamic Memory Usage

region    address                      maximum length  (dec)
------    -------                      ---------------------
heap      0                                   0  (0)
stack     0x1e40                              0x29c0  (10688)

Maximum dynamic memory (bytes):         0x29c0  (10688)

Executing: "C:\Programme\Microchip\MPLAB C30\bin\pic30-bin2hex.exe" 
"E:\Pic_24_Sourcecode\Stellpult_V1.1\StellpultController.cof"
Loaded E:\Pic_24_Sourcecode\Stellpult_V1.1\StellpultController.cof.
----------------------------------------------------------------------
Debug build of project 
`E:\Pic_24_Sourcecode\Stellpult_V1.1\StellpultController.mcp' succeeded.
Language tool versions: pic30-as.exe v3.21, pic30-gcc.exe v3.21, 
pic30-ld.exe v3.21, pic30-ar.exe v3.21
Preprocessor symbol `__DEBUG' is defined.
Sun Dec 20 19:37:36 2009
----------------------------------------------------------------------
BUILD SUCCEEDED


Gruß Siegfried

PS: arbeite mit C30 erst seit ein paar Tage
OP #1526610
Lesenswert?

Hallo,
hier letztes ergebnis.
sind noch mehrere >> Noch andere dicke Klöpse im RAM?
Data Memory  [Origin = 0x800, Length = 0x4000]

section   address      alignment gaps    total length  (dec)
-------   -------      --------------    -------------------
.ndata    0x800                   0          0x1300  (4864)
.nbss     0x1b00                   0           0x136  (310)
.ndata    0x1c36                   0             0x8  (8)
.nbss     0x1c3e                   0             0x2  (2)

Total data memory used (bytes):         0x1440  (5184) 31%

Ram ist trotz der erweiterung noch genügend vorhanden.

Data Memory ist belegt mit 5184 von 16384 Byte

Gruß Siegfried
#1526624
Lesenswert?

Circa 10 Sekunden Suche im Handbuch ergab:
 -mlarge-data
für mehr als 8KB Datenadressraum (Grenze 0x1FFF).

Alternativ kannst du wahrscheinlich auch ein paar Arrays entsprechend 
deklarieren, damit du bei der effizienteren Standardeinstellung bleiben 
kannst und nur diese Klöpse umständlicher adressiert werden müssen.

Lies bitte endlich das verdammte Handbuch durch. Von vorn bis hinten.
OP #1526654
Lesenswert?

Hallo  @A.K.
habe dieses als Beispiel gefunden.
int foo __attribute__((section("mysection"),address(0x900)));

Stell mir bitte dieses um.

#define max_table_funktion_memory 256 >> soll 512 sein
l_table_funktion_memory table_funktion_memory[max_table_funktion_memory] 
=
{
{0,0,0}    //  -->>
};

Habe es noch nicht gemacht.

Gruß Siegfried
OP #1527012
Lesenswert?

hallo  @ A.K.
habe es leider nur so hinbekommen.

l_table_auswahl_memory table_auswahl_memory[max_table_auswahl_memory] 
__attribute__((section("table_auswahl"),address(0x2000)));

Was mir nicht in den Sinn will, der C30 ist doch ein so moderner und 
leistungsfähiger Compiler, das dieser nicht selbst berechnen kann, wo 
ein Array mit der Größe X, angelegt wird.

Gruß Siegfried

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren