[LPC4088]: Networking was broking when splitting peripheral RAM into two... #120
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When the peripheral RAM was split into two 16 KB sections (AHBSRAM0 and AHBSRAM1) networking stopped to work. The reason is that section AHBSRAM1 is used at two locations in the networking code.
lwip/core/mem.c: allocates a ram heap of size MEM_SIZE (about 16KB aligned)
lwip-eth/arch/lpc17_emac.c: driver data lpc_enetdata is put in AHBSRAM1
When splitting peripheral RAM the total size of AHBSRAM1 is 16KB. This forced lpc_enetdata to be put in main SRAM. Since the Ethernet block in LPC4088 doesn't have access to main SRAM ethernet stopped working.
The fix was to reduce the size of the ram heap used by lwip. In the long run it would be better to avoid defining memory regions at several locations in the code.