<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>FTP client callback overflow?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/84975/ftp-client-callback-overflow</link><description>Hi Nordic! I&amp;#39;m using the nrf ftp client library found here: https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/networking/ftp_client.html I&amp;#39;m having problem with one specific line of code, which is this I get a cpu fault and the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 22 Feb 2022 19:09:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/84975/ftp-client-callback-overflow" /><item><title>RE: FTP client callback overflow?</title><link>https://devzone.nordicsemi.com/thread/354431?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 19:09:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f64676ba-0df6-4c72-979e-5207b63672ca</guid><dc:creator>nWre</dc:creator><description>&lt;p&gt;Dear Markus, it worked well, I had declared the callbacks wrong. Thank you very much for your time. Your code could be used as a nice example for the FTP-client if there are any more noobs in here.&lt;br /&gt;&lt;br /&gt;Have a great day!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FTP client callback overflow?</title><link>https://devzone.nordicsemi.com/thread/354266?ContentTypeID=1</link><pubDate>Tue, 22 Feb 2022 07:57:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:904fedf8-8600-4c9c-a093-279636cf539d</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p lang="en-GB"&gt;Hello again Niclas,&lt;/p&gt;
[quote user=""]I&amp;#39;m having problem with one specific line of code, which is this[/quote]
&lt;p lang="en-GB"&gt;As this code snippet is called from several functions in the library, during which step are you facing the fatal error?&lt;/p&gt;
&lt;p lang="en-GB"&gt;I have tested the API myself now in NCS v1.9.0 using mfw 1.3.1 and everything appears to work fine so far. See log below:&lt;/p&gt;
&lt;p lang="en-GB"&gt;&lt;pre class="ui-code" data-mode="text"&gt;*** Booting Zephyr OS build v2.7.99-ncs1  ***
Set up button at GPIO_0 pin 6
AT+CEREG=5
Modem response:
OK
AT%CESQ=1
Modem response:
OK
AT+CFUN=1
Modem response:
OK
AT notification received: %CESQ: 47,2,9,1

AT notification received: +CEREG: 2,&amp;quot;76C1&amp;quot;,&amp;quot;03106F00&amp;quot;,7

AT notification received: +CEREG: 1,&amp;quot;76C1&amp;quot;,&amp;quot;03106F00&amp;quot;,7,,,&amp;quot;00001010&amp;quot;,&amp;quot;11000001&amp;quot;

220 Welcome to the DLP Test FTP Server
200 Always in UTF8 mode.
331 Please specify the password.
230 Login successful.
215 UNIX Type: L8
211-FTP server status:
     Connected to 77.16.77.252
     Logged in as dlpuser
     TYPE: ASCII
     No session bandwidth limit
     Session timeout in seconds is 600
     Control connection is plain text
     Data connections will be plain text
     At session startup, client count was 65
     vsFTPd 3.0.2 - secure, fast, stable
211 End of status
221 Goodbye.
AT notification received: %CESQ: 49,2,15,2

AT notification received: %CESQ: 255,0,255,0&lt;/pre&gt;&lt;/p&gt;
&lt;p lang="en-GB"&gt;The FTP part of my code looks like this:&lt;/p&gt;
&lt;p lang="en-GB"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;	ret = ftp_init(ftp_ctrl_callback, ftp_data_callback);
	if(ret) {
		printk(&amp;quot;FTP Client initialisation failed: %d\n&amp;quot;, ret);
	}
	
	/* Modem initialisation and connecting to network */
	
	ret = ftp_open(&amp;quot;ftp.dlptest.com&amp;quot;, 21, -1);
	/* Positive values are FTP response codes */
	if(ret &amp;lt; 0){
		printk(&amp;quot;Failed to open a FTP connection: %d\n&amp;quot;, ret);
	}	

	/* Wait for answer from server */
	k_sem_take(&amp;amp;my_sem, K_FOREVER);

	ret = ftp_login(&amp;quot;dlpuser&amp;quot;,&amp;quot;rNrKYTX9g7z3RgJRmxWuGHbeu&amp;quot;);
	if(ret &amp;lt; 0){
		printk(&amp;quot;Login to FTP server failed: %d\n&amp;quot;, ret);
	}	

	/* Wait for answer from server */
	k_sem_take(&amp;amp;my_sem, K_FOREVER);

	ret = ftp_status();
	if(ret &amp;lt; 0){
		printk(&amp;quot;Requesting server status failed: %d\n&amp;quot;, ret);
	}	

	/* Wait for answer from server */
	k_sem_take(&amp;amp;my_sem, K_FOREVER);	

	ret = ftp_close();
	if(ret &amp;lt; 0){
		printk(&amp;quot;Disconnecting from server failed: %d\n&amp;quot;, ret);
	}	

	/* Wait for answer from server */
	k_sem_take(&amp;amp;my_sem, K_FOREVER);		&lt;/pre&gt;&lt;/p&gt;
&lt;p lang="en-GB"&gt;With ctrl and data callback defined as following:&lt;/p&gt;
&lt;p lang="en-GB"&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;void ftp_ctrl_callback(const uint8_t *msg, uint16_t len)
{
	printk(&amp;quot;%s&amp;quot;,msg);
	/* Release semaphore when receiving answer from server */
	k_sem_give(&amp;amp;my_sem);
}

void ftp_data_callback(const uint8_t *msg, uint16_t len)
{
	printk(&amp;quot;%s&amp;quot;,msg);
}&lt;/pre&gt;&lt;/p&gt;
&lt;p lang="en-GB"&gt;prj.conf:&lt;/p&gt;
&lt;p lang="en-GB"&gt;&lt;pre class="ui-code" data-mode="text"&gt;# General configurations
CONFIG_PRINTK=y
CONFIG_HEAP_MEM_POOL_SIZE=256
CONFIG_ASSERT=y
CONFIG_GPIO=y
CONFIG_NEWLIB_LIBC=y

# Modem library
CONFIG_NRF_MODEM_LIB=y
CONFIG_NRF_MODEM_LIB_SYS_INIT=y

# FTP Client
CONFIG_FTP_CLIENT=y

# Network
CONFIG_NETWORKING=y
CONFIG_NET_SOCKETS=y
CONFIG_NET_NATIVE=n&lt;/pre&gt;&lt;/p&gt;
&lt;p lang="en-GB"&gt;Regards,&lt;/p&gt;
&lt;p lang="en-GB"&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: FTP client callback overflow?</title><link>https://devzone.nordicsemi.com/thread/354143?ContentTypeID=1</link><pubDate>Mon, 21 Feb 2022 12:59:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a77e8c9a-5207-4125-bfa1-238a0805b6dc</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p lang="en-GB"&gt;Hello Niclas,&lt;/p&gt;
&lt;p lang="en-GB"&gt;I’ll try to reproduce this error and see if I can find the reason / root cause for the fatal error you are facing. I’ll keep you posted.&lt;/p&gt;
&lt;p lang="en-GB"&gt;Regards,&lt;/p&gt;
&lt;p lang="en-GB"&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>