SRAM in CYW42907

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
SaSh_283021
Level 1
Level 1

Hello,

How to use the 2Mb of SRAM in CYW43907 application?

I want to store data in SRAM and send later via SPI.

Thanks and Regards,

Sapan Shah

0 Likes
1 Solution

43xxx_Wi-Fi\apps\snip\secure_mqtt\secure_mqtt.c

void application_start( void )

{

    static wiced_mqtt_object_t mqtt_object;

    wiced_result_t ret = WICED_SUCCESS;

    uint32_t size_out;

    wiced_init( );

    /* Read root CA certificate (self certified) from resources*/

    resource_get_readonly_buffer( &resources_apps_DIR_secure_mqtt_DIR_secure_mqtt_root_cacert_cer, 0, MQTT_MAX_RESOURCE_SIZE, &size_out, (const void **) &security.ca_cert );

    security.ca_cert_len = size_out;

    /* Memory allocated for mqtt object*/

    mqtt_object = (wiced_mqtt_object_t) malloc( WICED_MQTT_OBJECT_MEMORY_SIZE_REQUIREMENT );

    if ( mqtt_object == NULL )

View solution in original post

0 Likes
5 Replies
Zhengbao_Zhang
Moderator
Moderator
Moderator
250 sign-ins First comment on KBA 10 questions asked

hello:

Are you using wiced for debugg ?  if so, try to use malloc function.

    rate_str = malloc(rate_str_len);
    if (rate_str == NULL) {
        WPRINT_APP_ERROR( ( "%s: malloc failure for rate string buffer.\n", fn_name ) );
        return ERR_OUT_OF_HEAP;
    }
0 Likes
SaSh_283021
Level 1
Level 1

Hello,

I am using malloc but malloc is giving hard fault.

0 Likes

hello:

We should have a lot of examples in the code release , you can take them as a reference.

0 Likes

Can you please share path or name of example?

Thanks and Regards,

Sapan Shah

0 Likes

43xxx_Wi-Fi\apps\snip\secure_mqtt\secure_mqtt.c

void application_start( void )

{

    static wiced_mqtt_object_t mqtt_object;

    wiced_result_t ret = WICED_SUCCESS;

    uint32_t size_out;

    wiced_init( );

    /* Read root CA certificate (self certified) from resources*/

    resource_get_readonly_buffer( &resources_apps_DIR_secure_mqtt_DIR_secure_mqtt_root_cacert_cer, 0, MQTT_MAX_RESOURCE_SIZE, &size_out, (const void **) &security.ca_cert );

    security.ca_cert_len = size_out;

    /* Memory allocated for mqtt object*/

    mqtt_object = (wiced_mqtt_object_t) malloc( WICED_MQTT_OBJECT_MEMORY_SIZE_REQUIREMENT );

    if ( mqtt_object == NULL )

0 Likes