Hello again!
Autoanswer! we solved the problem with linker file generated by Processor Expert with this modified 'lcf' file:
KEEP_SECTION { .vectortable }
KEEP_SECTION { .cfmconfig }
KEEP_SECTION { .fapp_params }
MEMORY {
m_interrupts (RX) : ORIGIN = 0x00000000, LENGTH = 0x000001E0
m_text (RX) : ORIGIN = 0x00000410, LENGTH = 0x0003F3F0
fapp_paramsrom (RW) : ORIGIN = 0x0003F800, LENGTH = 0x00000800 # 2kBytes: last logical block reserved for params
m_data (RW) : ORIGIN = 0x1FFF8000, LENGTH = 0x00010000
m_cfmprotrom (RX) : ORIGIN = 0x00000400, LENGTH = 0x00000010
}
SECTIONS {
## Heap and Stack sizes definition
__heap_size = 0x0400;
___stack_size = 0x0400;
.interrupts :
{
__vector_table = .;
* (.vectortable)
. = ALIGN (0x4);
} > m_interrupts
.cfmprotect :
{
*(.cfmconfig)
. = ALIGN (0x4);
} > m_cfmprotrom
.text :
{
* (.text)
. = ALIGN(0x4);
* (.rodata)
. = ALIGN(0x4);
___ROM_AT = .;
___DATA_ROM = .;
} > m_text
.data : AT(___ROM_AT)
{
___DATA_RAM = .;
*(.FNET_RAM) #Flash driver "in ram" function.
* (.data)
.= ALIGN(0x4) ;
* (.ARM.extab)
. = ALIGN(0x4);
__exception_table_start__ = .;
EXCEPTION
__exception_table_end__ = .;
__sinit__ = .;
STATICINIT
___DATA_START =.;
* (.data)
. = ALIGN (0x4);
## Additional data sections defined by components
. = ALIGN (0x0200);
* (.USB_LDD_memory_section)
___DATA_END =.;
__SDATA_START =.;
* (.sdata)
. = ALIGN (0x4);
__SDATA_END = .;
__SDA_BASE = .;
. = ALIGN(0x4);
} > m_data
.bss :
{
__START_SBSS = .;
* (.sbss)
*(SCOMMON)
__END_SBSS = .;
__START_BSS = .;
* (.bss)
* (COMMON)
__END_BSS = .;
. = ALIGN(0x4);
} >> m_data
___HEAP_START = .;
___HEAP_END = ___HEAP_START + __heap_size;
___SP_END = ___HEAP_END;
___SP_INIT = ___SP_END + ___stack_size;
__heap_addr = ___HEAP_START;
__heap_size = ___HEAP_END - ___HEAP_START;
__SP_INIT = ___SP_INIT;
_romp_at = ___ROM_AT + SIZEOF(.data);
.romp : AT(_romp_at)
{
__S_romp = _romp_at;
WRITEW(___ROM_AT);
WRITEW(ADDR(.data));
WRITEW(SIZEOF(.data));
WRITEW(0);
WRITEW(0);
WRITEW(0);
}
# ====== Definitions used by FNET Application. =======
.params :
{
*(.fapp_params)
} > fapp_paramsrom
__VECTOR_RAM = ADDR(.interrupts);
}
As you can notice we put FNET parameters in flash RAM space (see last line) and aligned 'm_data' to 0x200 (512) as requested by USB stack.
But we encountered another "little" problem we didn't face before in our TCP send/receive experiments: we manage to send only 10 bytes to a TCP port, not more, despite we charge a char array buffer with more, and we provide the correct size to send.
Here's some relevant code:
char g_curr_send_buf[] = "Ciao Amiga!!!"; // setting send buffer: 13 bytes plus end-of-string character
[other code...]
size = sizeof(g_curr_send_buf);
send_res = send(socket_foreign, (char*)(&g_curr_send_buf), size, 0);
In the omnipresent Hercules program running on PC :-) we got just "Ciao Amiga" continously, no "!!!".
I have tried and unplesant FOR cycle send 1 byte at time running for 'size', but I got mix-mashed output on Hercules side (eg. Ciao AmiCiao Amiga io Ami...).
Any clue regarding this?
I checked send buffers:
| #define FNET_CFG_SOCKET_TCP_TX_BUF_SIZE | (2 * 1024) |
Am I missing some very basic setting?
Thanks a lot for any help!
Luca O. \8^)