Memory allocation error with bootloader

I have a big problem with LPC2387 and http-upload demo project when it's loaded by bootloader.
After one ten of minute that the application it's running with one ftp connection and one http connection that try to download the same a big file; the application hangs with this error:

MEM ERR: Alloc, No memory Used 5300 bytes, 12 blocks

This error occur also with only continuously ping without any communication with the socket but the error occur after some hour.

If the ethernet cable is disconnected the application run well without problem.

I think that the remap of the vector interrupts by the application it's correct. I have used the define REMAP RAM_MODE RAM_INTVEC and the interrupt like serial, timer, ethernet and so on it's ok.

In the startup file of application I have forced the cpu to go to the supervisor mode to properly setting of stack and heap of the application with this piece of code:

SWI_RAM_ADDR EQU 0x40000028 LDR R8, =SWI_RAM_ADDR LDR R7, [R8] LDR R9, =Stack_Set_Addr STR R9, [R8] SWI 11
Stack_Set_Addr DCD Stack_Setup
Stack_Setup STR R7, [R8]

This is my setting of bootloader and project application:

-> Bootloader:
Secondary SD Bootloader from nxp:
No RTX
IROM1 address 0x0000, size 0x10000
IRAM1 address 0x4000000, size 0x1000
Heap Size: 0x400
Stack Size (user Mode): 0x400

-> Application: Http_upload demo project without RTX

IROM1 address 0x10000, size 0x70000
IRAM1 address 0x4000040, 0xFFC0 //Save first 64 byte for remap interrupt
IRAM2 address 0x7FD0000, size 0x4000
Ass Define: REMAP RAM_MODE RAM_INTVEC

I already tried:

1) Change Memory pool in Net_config.c (increase or decrease) -> problem no solved
2) Increase Heap Size of Bootloader or/and application -> no solution
3) Increase Stack Size in User Mode in bootloader and/or application -> no solution
4) Build the application without bootloader but with Remapping of interrupts vector -> no solution

I'm afraid that the promblem it's the use of DMA or Memory allocation when the interrupt are mapped in the RAM.

Someone have any solution for me?

Thank's

Parents
  • I don't know much about this.
    But maybe

    IRAM1 address 0x4000040, 0xFFC0 //Save first 64 byte for remap interrupt
    


    64 Bytes is not enough for ISP/IAP.

    UM10211
    Chapter 29: LPC23XX Flash memory programming firmware

    3.2.8 RAM used by ISP command handler
    ISP commands use on-chip RAM from 0x4000 0120 to 0x4000 01FF. The user could use
    this area, but the contents may be lost upon reset. Flash programming commands use the
    top 32 bytes of on-chip RAM. The stack is located at RAM top - 32. The maximum stack
    usage is 256 bytes and it grows downwards.

    Maybe see this:
    http://www.keil.com/forum/20257/

Reply
  • I don't know much about this.
    But maybe

    IRAM1 address 0x4000040, 0xFFC0 //Save first 64 byte for remap interrupt
    


    64 Bytes is not enough for ISP/IAP.

    UM10211
    Chapter 29: LPC23XX Flash memory programming firmware

    3.2.8 RAM used by ISP command handler
    ISP commands use on-chip RAM from 0x4000 0120 to 0x4000 01FF. The user could use
    this area, but the contents may be lost upon reset. Flash programming commands use the
    top 32 bytes of on-chip RAM. The stack is located at RAM top - 32. The maximum stack
    usage is 256 bytes and it grows downwards.

    Maybe see this:
    http://www.keil.com/forum/20257/

Children
More questions in this forum