CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

STACK_USE_MPFS + MPFS_USE_EEPROM

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
salihonur



Joined: 21 Mar 2020
Posts: 22

View user's profile Send private message

STACK_USE_MPFS + MPFS_USE_EEPROM
PostPosted: Sat Apr 17, 2021 9:45 am     Reply with quote

Hi guys,

I want to use a dedicated external eeprom for the web pages. Because above 7KB web storage, I'm getting TRAP_CONFLICT. I need to store min 14KB.

Ther are 3 pcs 24LC512 chips on I2C bus. So one will be dedicated for the web pages.

My Questions:
1) How can I set the address of specific eeprom for the MPFS?
2) What settings are required? STACK_USE_MPFS, MPFS_USE_EEPROM, MPFS_RESERVE_BLOCK and else?
3) What is the difference between STACK_USE_MPFS and STACK_USE_MPFS2?

MCU: PIC24FJ256GB106
Compiler: 5.091

Existing settings:
Code:
#define STACK_USE_ICMP_SERVER    1
#define STACK_USE_TCP            1
#define STACK_USE_DNS            1
#define STACK_USE_ARP            1
#define STACK_USE_DHCP_CLIENT    1
//#define STACK_USE_DHCP_SERVER       1
#define STACK_USE_CCS_SNTP_CLIENT    1
#define STACK_USE_CCS_ANNOUNCE       1


#define STACK_CCS_SMTP_TX_SIZE    0
#define STACK_CCS_SMTP_RX_SIZE    0

#define STACK_USE_CCS_HTTP2_SERVER
#define STACK_CCS_HTTP2_SERVER_TX_SIZE    1500
#define STACK_CCS_HTTP2_SERVER_RX_SIZE    500
#define HTTP_NUM_SOCKETS                  1
#define HTTP_PORT                         (80u)
#define HTTP_USE_DOUBLE_ESCAPE            1
#define HTTP_USE_AUTHENTICATION             TRUE
//#define HTTP_SERVER_HTACCESS_FILE           TRUE
#import(RAW, file="mpfs/mpfsimg.bin", location=MPFS_Start, bpi=2)

#define STACK_USE_CCS_HTTP_CLIENT
#define STACK_MY_HTTPC_RX_SIZE    128
#define STACK_MY_HTTPC_TX_SIZE    128

#define STACK_MY_TELNET_SERVER_TX_SIZE    0
#define STACK_MY_TELNET_SERVER_RX_SIZE    0

#define MY_DEFAULT_HOST_NAME      "XXXXXXXX"

#define MY_DEFAULT_MAC_BYTE1      (0x0)
#define MY_DEFAULT_MAC_BYTE2      (0x20)
#define MY_DEFAULT_MAC_BYTE3      (0x30)
#define MY_DEFAULT_MAC_BYTE4      (0x40)
#define MY_DEFAULT_MAC_BYTE5      (0x50)
#define MY_DEFAULT_MAC_BYTE6      (0x60)

#define MY_DEFAULT_IP_ADDR_BYTE1  (192ul)
#define MY_DEFAULT_IP_ADDR_BYTE2  (168ul)
#define MY_DEFAULT_IP_ADDR_BYTE3  (1ul)
#define MY_DEFAULT_IP_ADDR_BYTE4  (99ul)

#define MY_DEFAULT_GATE_BYTE1     (192ul)
#define MY_DEFAULT_GATE_BYTE2     (168ul)
#define MY_DEFAULT_GATE_BYTE3     (1ul)
#define MY_DEFAULT_GATE_BYTE4     (1ul)

#define MY_DEFAULT_MASK_BYTE1     (255ul)
#define MY_DEFAULT_MASK_BYTE2     (255ul)
#define MY_DEFAULT_MASK_BYTE3     (255ul)
#define MY_DEFAULT_MASK_BYTE4     (0ul)

#define TCP_CONFIGURATION      2

#define TCP_ETH_RAM_SIZE (STACK_CCS_SMTP_TX_SIZE + \
                          STACK_CCS_SMTP_RX_SIZE + \
                          STACK_CCS_HTTP2_SERVER_TX_SIZE + \
                          STACK_CCS_HTTP2_SERVER_RX_SIZE + \
                          STACK_MY_TELNET_SERVER_TX_SIZE + \
                          STACK_MY_TELNET_SERVER_RX_SIZE + \
                          STACK_MY_HTTPC_TX_SIZE + \
                          STACK_MY_HTTPC_RX_SIZE + \
                          100*TCP_CONFIGURATION)

// Define names of socket types
#define TCP_PURPOSE_GENERIC_TCP_CLIENT 0
#define TCP_PURPOSE_GENERIC_TCP_SERVER 1
#define TCP_PURPOSE_TELNET             2
#define TCP_PURPOSE_FTP_COMMAND        3
#define TCP_PURPOSE_FTP_DATA           4
#define TCP_PURPOSE_TCP_PERFORMANCE_TX 5
#define TCP_PURPOSE_TCP_PERFORMANCE_RX 6
#define TCP_PURPOSE_UART_2_TCP_BRIDGE  7
#define TCP_PURPOSE_HTTP_SERVER        8
#define TCP_PURPOSE_DEFAULT            9
#define TCP_PURPOSE_BERKELEY_SERVER    10
#define TCP_PURPOSE_BERKELEY_CLIENT    11
#define TCP_PURPOSE_CCS_SMTP           0x40

typedef struct
{
   BYTE vSocketPurpose;
   BYTE vMemoryMedium;
   WORD wTXBufferSize;
   WORD wRXBufferSize;
} TCPSocketInitializer_t;

#ifndef MAX_HTTP_CONNECTIONS
   #define  MAX_HTTP_CONNECTIONS 1
#endif
#ifndef MAX_UDP_SOCKETS
   #define MAX_UDP_SOCKETS 7
#endif


_________________
Compiler v5.091+ Windows 10
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

PostPosted: Sun Apr 18, 2021 11:47 pm     Reply with quote

Hey there!

If I may ask first -- can you compile your project with test web pages and get it to work writing it to PIC FLASH?

I ask because last I knew, the CCS TCPIP stack (which was modeled after the old Microchip TCPIP stack version 3.75(?) didn't work on the PIC24/33/32 series CPUs.

If you have got it working -- and now you're just moving to web pages on FLASH, let me know.

I'll go look at my old code for external FLASH (although it was on a PIC18F97J60) to see how I had MPFS set up. (I was using a 2MB external FLASH for my web pages.)

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
bkamen



Joined: 07 Jan 2004
Posts: 1615
Location: Central Illinois, USA

View user's profile Send private message

Re: STACK_USE_MPFS + MPFS_USE_EEPROM
PostPosted: Sun Apr 18, 2021 11:58 pm     Reply with quote

salihonur wrote:
Hi guys,

I want to use a dedicated external eeprom for the web pages. Because above 7KB web storage, I'm getting TRAP_CONFLICT. I need to store min 14KB.

Ther are 3 pcs 24LC512 chips on I2C bus. So one will be dedicated for the web pages.

My Questions:
1) How can I set the address of specific eeprom for the MPFS?
2) What settings are required? STACK_USE_MPFS, MPFS_USE_EEPROM, MPFS_RESERVE_BLOCK and else?
3) What is the difference between STACK_USE_MPFS and STACK_USE_MPFS2?


Ok, I'll answer these out of order...

3 - MPFS2 was the successor to MPFS and if you can, usually you want to use MPFS2.
1 - from my quick review of my code and the MPFS1/2 docs, I2C FLASH isn't natively supported. (that I see) That's not to say you can't add it -- but it would answer your question as to "how do I address it" -- you're going to have to write the hardware level driver for the FLASH memories you're using.

2 - in my project, I have

STACK_USE_MPFS2
MPFS_USE_SPI_FLASH
MPFS_RESERVE_BLOCK (4096UL)
MAX_MPFS_HANDLES (13UL)


Hope that helps,

-Ben
_________________
Dazed and confused? I don't think so. Just "plain lost" will do. :D
salihonur



Joined: 21 Mar 2020
Posts: 22

View user's profile Send private message

Re: STACK_USE_MPFS + MPFS_USE_EEPROM
PostPosted: Thu Apr 22, 2021 1:50 pm     Reply with quote

bkamen wrote:
salihonur wrote:
Hi guys,

I want to use a dedicated external eeprom for the web pages. Because above 7KB web storage, I'm getting TRAP_CONFLICT. I need to store min 14KB.

Ther are 3 pcs 24LC512 chips on I2C bus. So one will be dedicated for the web pages.

My Questions:
1) How can I set the address of specific eeprom for the MPFS?
2) What settings are required? STACK_USE_MPFS, MPFS_USE_EEPROM, MPFS_RESERVE_BLOCK and else?
3) What is the difference between STACK_USE_MPFS and STACK_USE_MPFS2?


Ok, I'll answer these out of order...

3 - MPFS2 was the successor to MPFS and if you can, usually you want to use MPFS2.
1 - from my quick review of my code and the MPFS1/2 docs, I2C FLASH isn't natively supported. (that I see) That's not to say you can't add it -- but it would answer your question as to "how do I address it" -- you're going to have to write the hardware level driver for the FLASH memories you're using.

2 - in my project, I have

STACK_USE_MPFS2
MPFS_USE_SPI_FLASH
MPFS_RESERVE_BLOCK (4096UL)
MAX_MPFS_HANDLES (13UL)


Hope that helps,

-Ben


Hi bkamen.

Yes I can run web pages up to 9KB without any problem. Thanks for your information. I will test with SPI and will try to write I2C library. It might be slower than SPI but I don't care it for now.
_________________
Compiler v5.091+ Windows 10
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Mon Apr 26, 2021 6:06 pm     Reply with quote

If you can guarantee no interruption in chip power - i can show you how to use main data memory to hold your data instead of EEPROM - surviving PIC software resets and all. But not a cold power off. For this scheme to work - you need to keep chip power on for as long as the data you load into the space matters to you. Other smaller configuration data that needs less frequent accessed can still live in EEPROM. I use this method to save / modify up to 2400 bytes of data -battery backed -on a 18F46k22 all loaded in by RS232 + with check values at power up of the device. With one chance in 2^32 of falsely indicating data validity.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group