LPC4337 and dualcore/freertos

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC4337 and dualcore/freertos

591 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by snovik on Wed Mar 05 09:37:51 MST 2014
Hello.

1)Download LPCOpen examples. Run example simple webserver - it's work, but dualcore/dualcore_freertos examples not work.

These examples are made under lpс4330, I configured MCU settings settings changed to lpc4337 in LPCExpresso, but it did not help.

How do I start these projects?

P.S. Use NGX Xplorer LPC4337 board, lpcxpresso v6.1 and 7.

2) Are there examples of the FTP server for lpс4337?
Labels (1)
0 Kudos
3 Replies

450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by iaun.hma67 on Tue Oct 06 01:50:12 MST 2015
hello
I am a beginner in lpc4337 and trying to make a project by this processor...
I want to blink the LEDs connected to P6.9 & P6.10 with core M0 and blink the other tow LEDs connected to P6.11 & P6.12 with coreM4.
I am working by keil 5 and registers without using of CMSIS standard function. my programmer is j_link and I have work on OPEN18xx/43xxB1 training board(fabricated by Wave Share).
by using your post and others I don't understand how to configure my program :((
I write this code for core M0 :

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#include <LPC43xx.h>

void delay_ms(int Del)
{
long int i;
for(i=0;i<Del*8000;i++);
}
int main(void)
{

//LED4 P6.9   GPIO3[5]  FUNC0
LPC_SCU->SFSP6_9=0x00000028;
LPC_GPIO_PORT->DIR[3] |= (1 <<5);
  //LED3 P6.10  GPIO3[6]  FUNC0 
LPC_SCU->SFSP6_10=0x00000028;
LPC_GPIO_PORT->DIR[3] |= (1 <<6);
while (1)
{                          
LPC_GPIO_PORT->SET[3]=1<<5;       // GPIO3[5] :   (LED D4)
delay_ms(500);
LPC_GPIO_PORT->SET[3]=1<<6;       // GPIO3[6] :   (LED D3)
delay_ms(500);
LPC_GPIO_PORT->CLR[3]=1<<5;       // GPIO3[5] :   (LED D4)
delay_ms(500);
LPC_GPIO_PORT->CLR[3]=1<<6;       // GPIO3[6] :   (LED D3)
delay_ms(500);
}
}

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
and setting for M0 core like this:

image1

image2

image3

image4

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

and this code for core M4 in the other project:

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////  
#include <LPC43xx.h>

void delay_ms(int Del)
{
long int i;
for(i=0;i<Del*8000;i++);
}

/* Boot the M0 core */
void lpc43xx_m0_boot(void)
{
/* Make sure the M0 core is being held in reset via the RGU */
LPC_RGU->RESET_CTRL1 = (1 << 24);
}



int main(void)
{


//LED2 P6.11  GPIO3[7]  FUNC0
LPC_SCU->SFSP6_11=0x00000028;
LPC_GPIO_PORT->DIR[3] |= (1 <<7);
//LED1 P6.12  GPIO2[8]  FUNC0
LPC_SCU->SFSP6_12=0x00000028;
LPC_GPIO_PORT->DIR[2] |= (1 <<8);

while (1)
{                          
LPC_GPIO_PORT->SET[3]=1<<7;       // GPIO3[7] :   (LED D2)
delay_ms(1000);
LPC_GPIO_PORT->SET[2]=1<<8;       // GPIO2[8] :   (LED D1)
delay_ms(1000);
LPC_GPIO_PORT->CLR[3]=1<<7;       // GPIO3[7] :   (LED D2)
delay_ms(1000);
LPC_GPIO_PORT->CLR[2]=1<<8;       // GPIO2[8] :   (LED D1)
delay_ms(1000);

}
}

///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
and setting for M0 core like this:

image5

image6

image7

image8

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
i should say that i use wizard project in keil 5 to make these tow project  & i want to run all of these project by using any new heeder file or lib :~
i want to do all the necessary work like releasing M0 core from reset just by basic registers.
i read all of corresponsive post in this site and in internet, but i just confused !!!
thank you for attention
0 Kudos

450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by danny_com on Thu Sep 04 03:26:13 MST 2014
Can you explain better step 3 and 4 (if it is necessary to set the starting memory address for the Program Flash or other change we have to do). Because I have followed your steps but I get a Hard Fault when is starting the M0.

if (M0Image_Boot((uint32_t) M0_IMAGE_ADDR) < 0) {
while (1) {
__WFI();
}
}
0 Kudos

450 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by sundarapandian on Thu Mar 13 14:49:00 MST 2014
Before running the example please make sure you have no valid image in your iflash [LPCOpen examples for NGX Xplorer is built for LPC4330 SPIFI Target], and the boot switches are set to SPIFI boot mode, power the board by connecting USB cable to USB0 [not USB1]. Note that the dualcore examples need images for both the cores [programming flash with only M4 or M0 will not work]

To run dualcore freertos webserver please follow the steps given below [Uses USB mass storage as the M0 image]

[list=1]
  [*] Download the latest lpcopen package for NGX Xplorer 4330, from http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc43xx-packages
  [*] Open LPCXpresso v7.0.2 and import [dc_freertos_webserver, dc_sa_msc_ram_m0, lpc_board_ngx_xplorer_4330, lpc_chip_43xx, lpc_board_ngx_xplorer_4330_m0 and lpc_chip_43xx_m0]
  [*] Build project dc_sa_msc_ram_m0, click the Program Flash button on the toolbar and program the image generated "dc_sa_msc_ram_m0.axf"
  [*] Build project dc_freertos_webserver and start the debugger
  [*] Skip to step 10, if you have a working UART console [IP Address information is printed on UART, press Resume button in toolbar to continue]
  [*] Open file dualcore_webserver.c and set break point inside function ip_addr_changed at the line that prints NET_MASK
  [*] Use resume button in the toolbar to resume execution
  [*] Once the board acquires IP address the execution will hit the breakpoint
  [*] The IP address can be obtained by adding tmp_buff in expressions window, use Resume button in toolbar to continue
  [*] Open a browser in the host machine [connected to the same subnet] type in http://[board IP address]
  [*] You must be able to get the web page from webserver
  [*] USB mass storage code running in M0 wil give access to index.htm which could be modified
[/list]

Note that you can run dc_sa_blinky_m0 as the M0 image in which case the webserver running on M4 will provide you with the default html page. It is also possible to run sa_freertos_webserver_m0 in the M0 core and dc_sa_msc_ram as the M4 image [in this case you must connect the UART to obtain the IP address or assign static IP address].

By searching internet for lwip ftp server I found http://www.crowproductions.de/lwipdev_en.php/ftpd.zip, we have never used this or tested you might have to use it at your own risk.
0 Kudos