How can I update the length of a base field definition in an update hook?
I was having the exact same issue, trying to update the "max_length" of the name field of a custom entity.
I did a hook_update like that :

function mymodule_update_8005() {
  $entity_definition_update_manager = \Drupal::service('entity.definition_update_manager');
  $field_definition = $entity_definition_update_manager-&gt;getFieldStorageDefinition('name', 'myentityid');
  $field_definition-&gt;setSetting('max_length', 255);
  $entity_definition_update_manager-&gt;updateFieldStorageDefinition($field_definition);
}


But then, even if the fieldDefinition had correctly changed, I was still having the old length limitation.

Finally, what I had forgotten to do was changing this max_length in my entity definition itself, here :

public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
  $fields['name'] = BaseFieldDefinition::create('string')
  -&gt;setLabel(t('Title'))
  -&gt;setSettings(array(
    'max_length' =&gt; 255,
    'text_processing' =&gt; 0,
  ));
  ...


After that, it worked as desired.